Why do I keep getting a 501 mail error?
| From: | Brian Dunning | Date: | Thu, 05 Aug 2004 15:42:49 +0000 |
| Subject: | Why do I keep getting a 501 mail error? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192885@lists.php.net to get a copy of this message | ||
Developing on a Windows server to be deployed on Linux. I get "SMTP server response: 501 Bad address syntax." Here's my code:
$mail_from = 'My Name <name@domain.com>';
$mail_server = 'mail.servername.com'; // This is hosted externallyini_set("SMTP", $mail_server); ini_set("sendmail_from", $mail_from); $mail_to = "$first_name $last_name <$email>"; mail($mail_to, "Here is my subject", "Please click this link to activate your account:\n\n$http_root"."owner.php?id=$entry_code", "To: $mail_to\nFrom: $mail_from\nContent-type: text/plain\nMailer: PHP/".phpversion()); I read about trying \r\n instead of \n in the headers, but it didn't seem to make any difference, and \n is working on other mail actions on this same server. Thanks for any clues... :)