Jump to content

Problem Sending Emails


Recommended Posts

Hi, I installed apache/php/mysql 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 webhost

The error message I am getting is along these lines

[quote]Warning: mail() [function.mail]: SMTP server response: 501 <New Zealand Society for Oncology <myemail@myhost.com>>: "@" 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 = "myemail@myhost.com";

$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 fine, so it likes the format "myemail@myhost.com" but not "New Zealand Society for Oncology <myemail@myhost.com>"

Can anyone suggest a way to fix this?

Cheers
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.