0

Hi,
I am having a problem with my PHP mail function. I am trying to send an email from user@site.com. This code is fine:

mail($to, $subject, $body,
    "From: user@site.com\n" .
    "MIME-Version: 1.0\n" .
    "Content-Type: multipart/alternative;\n" .
    "     boundary=" . $mime_boundary_header) or die('Mail Error');

however this does not

mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\n" .
    "MIME-Version: 1.0\n" .
    "Content-Type: multipart/alternative;\n" .
    "     boundary=" . $mime_boundary_header) or die('Mail Error');

The exact error returned is

[Sat Sep 26 21:08:11 2009] [error] [client 127.0.0.1] PHP Warning:  mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 501 &lt;&lt;TubeTool&gt; user@site&gt;: missing or malformed local part in [removed for security]\\scripts\\0\\saccount\\signup.php on line 168, referer: [...]

Please note that the &lt; and &gt; are exactly that in the error log not < or >
Regards,
Sam Rudge

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by crazyb0y
0

Perhaps this might be better:

mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\r\n" .
    "MIME-Version: 1.0\r\n" .
    "Content-Type: multipart/alternative;\r\n" .
    "     boundary=" . $mime_boundary_header."\r\n") or die('Mail Error');
0

Perhaps this might be better:

mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\r\n" .
    "MIME-Version: 1.0\r\n" .
    "Content-Type: multipart/alternative;\r\n" .
    "     boundary=" . $mime_boundary_header."\r\n") or die('Mail Error');

Thanks for the suggestion but same error again :(

0
mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\r\n" .
    "MIME-Version: 1.0\r\n" .
    "Content-Type: multipart/mixed; boundary=\"----------A4D921C2D10D7DB\"\r\n") or die('Mail Error');
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.