OK, I made the change and this is what I got when I tried it.
Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\Inetpub\wwwroot\pughcachets.com\www\gbook\gbook.php on line 466
Now what??? Any ideas?
error message for guestbook
Don't understand
I'm sorry, I don't mean to sound dumb, but I don't understand what I am supposed to do. I am trying to get this guestbook setup for someone else's website, so the email will be going to them, not me. The website is on an individual's server, so I am at their mercy to get settings, etc. done that need to be changed on the server for this to work properly.
I am just about to give up on this even though I love the way the guestbook is supposed to work.
I am just about to give up on this even though I love the way the guestbook is supposed to work.
I looked around at the internet and it seems that some smtp servers with iis do not support a "to name" so you can send it to an email but not along with a name. So try changing line 466 to:or:Where the e-mail address (name@website.com) could be something like gbook@pughcachets.com . This method is more likely to work because in the first code an e-mail address must be filled in by the submitter of the message otherwise you get an empty "from" header and this could be not accepted by the mail server.
If this does not work:
Henrie
Code: Select all
mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $email");
Code: Select all
mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: name@website.com");
If this does not work:
- Do you know if the mail function of the server on which the other persons website is placed is properly set up? Can you sent e-mail at all from this server (for example with a mail form)?
- Ask the owner of the server that hosts the website what settings you have to use (or can not use) in a script to send mail via the server.
Henrie
Last edited by Henrie on Tue Oct 25, 2005 5:16 am, edited 1 time in total.
Glad I could help you.
For other readers who have the same problem an answer to your last question.
The "From" header shows the receiver of the e-mail where the e-mail came from.
This is normally a name with an e-mail address or just an e-mail addres.
This is not the e-mail address that it should be send to. In the code given this is set by $settings[admin_email] which is defined in the settings.php file.
The subject of the e-mail you receive is the second parameter and is now Someone has just signed your guestbook. So this could be changed if you would like to (keep the quotes "").
With the first code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $name <$email>\r\n"); you would see the name of the submitter (taken from the script) with his e-mail address (when given).
With the second code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $email"); just the e-mail address of the submitter would be shown. But as email is not a required field this value could als be empty which obviously is not permitted by all e-mail servers.
With the third code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: name@website.com"); the e-mail is allways send with the same "from" header. So you should change name@website.com to a more descriptive address like gbook@mywebsite.com
Henrie.
For other readers who have the same problem an answer to your last question.
The "From" header shows the receiver of the e-mail where the e-mail came from.
This is normally a name with an e-mail address or just an e-mail addres.
This is not the e-mail address that it should be send to. In the code given this is set by $settings[admin_email] which is defined in the settings.php file.
The subject of the e-mail you receive is the second parameter and is now Someone has just signed your guestbook. So this could be changed if you would like to (keep the quotes "").
With the first code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $name <$email>\r\n"); you would see the name of the submitter (taken from the script) with his e-mail address (when given).
With the second code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: $email"); just the e-mail address of the submitter would be shown. But as email is not a required field this value could als be empty which obviously is not permitted by all e-mail servers.
With the third code mail("$settings[admin_email]","Someone has just signed your guestbook",$message,"From: name@website.com"); the e-mail is allways send with the same "from" header. So you should change name@website.com to a more descriptive address like gbook@mywebsite.com
Henrie.
That's a good thing to know, thanks!Henrie wrote:I looked around at the internet and it seems that some smtp servers with iis do not support a "to name" so you can send it to an email but not along with a name.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Hello Klemen,
I found the message here http://forum.mamboserver.com/showthread ... 533&page=2
The message was:
I found the message here http://forum.mamboserver.com/showthread ... 533&page=2
The message was:
Greetings Henriephp4.3 Apache2.0.43 IIS SMTP server
the smtp server with iis5 does not support a TO NAME,
you can send it to an email but not along with a name.
to say $to = "Miki <Miki@email.com>"; would not be accepted and you will get an error 501 Invalid address.
if you see this error, just try NOT sending emails with a TO name, only the email should be entered