changing "from" field on receiving email

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
AndyF
Posts: 10
Joined: Thu Jun 07, 2012 3:55 pm

changing "from" field on receiving email

Post by AndyF »

When I receive a notification that someone has signed my guestbook, it arrives as from "CGI-Mailer". As I have brought two licences for two different guestbooks, I would rather the from field said something along the lines of "from website A" or "from website B"

Is there a field I can adjust to make this possible ?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: changing "from" field on receiving email

Post by Klemen »

You would have to edit the gbook.php file a bit. Nothing too scary though, just open gbook.php in Notepad and use "Find" to find this exact code:

Code: Select all

,"Content-type: text/plain; charset=".$lang['enc']
Replace it with:

Code: Select all

,"From: $settings[website_title] <$settings[admin_email]>\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']
You need to do that TWICE in the gbook.php file!

Then (unless your host is overwriting "From" header) it should say "From: Website title <you@yourmail.com>"
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
AndyF
Posts: 10
Joined: Thu Jun 07, 2012 3:55 pm

Re: changing "from" field on receiving email

Post by AndyF »

That works lovely - many thanks for your help
Post Reply