From: "Brian Dunning" <[EMAIL PROTECTED]>

> 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 <[EMAIL PROTECTED]>';
> $mail_server = 'mail.servername.com';     // This is hosted externally
> ini_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...  :)

The first step is to see if you can send a mail using a very basic call to
mail(), simply: mail('[EMAIL PROTECTED]','subject','message');

If that works, then you can move on by slowly adding the code you have
above.

Why do you have two To: headers? That'll mess things up. remove the one from
the "extra headers" parameter.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to