sanfly Posted November 21, 2006 Share Posted November 21, 2006 Hi, I installed WAMP on my PC for testing my php pages, and im having a little trouble with scripts that require emails to be sent. I will point out straght away that these scripts all work fine when I upload them to my webhostThe error message I am getting is along these lines[quote]Warning: mail() [function.mail]: SMTP server response: 501 <New Zealand Society for Oncology <[email protected]>>: "@" or "." expected after "New" in C:\server\www\NZSO\sendmessage.php on line 108[/quote]This is my sendmail script[code=php:0]$user_passwords_sender = "New Zealand Society for Oncology";$user_passwords_email = "[email protected]";$sendmail = mail($mail_to_email, $subject, $message, "From: $user_passwords_sender <$user_passwords_email>\nX-Mailer: PHP/" . phpversion());[/code]All I can guess from this is that for some reason it thinks that the name of recipient + email address is the email address, ie: it doesnt recogonise the format the "From" header is in. If I change my sendmail script to:[code=php:0]$sendmail = mail($mail_to_email, $subject, $message, "From: $user_passwords_email \nX-Mailer: PHP/" . phpversion());[/code]it works fineCan anyone suggest a way to fix this?Cheers Link to comment https://forums.phpfreaks.com/topic/27940-problem-sending-emails/ Share on other sites More sharing options...
hackerkts Posted November 24, 2006 Share Posted November 24, 2006 Hope this link will solve your problem,http://phpmailer.sourceforge.net/Regards,SkY Link to comment https://forums.phpfreaks.com/topic/27940-problem-sending-emails/#findComment-129576 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.