ID: 22812
Updated by: [EMAIL PROTECTED]
Reported By: dbakr at evalica dot com
-Status: Open
+Status: Bogus
Bug Type: Mail related
Operating System: Windows XP
PHP Version: 4.3.1
New Comment:
The first parameter to mail() should *only* be the email address
itself. This is the documented and expected behavior for mail(). If
you're curious why this is, I invite you to read the RFC relating to
the SMTP protocol.
If you would like to make sure your header contains the correct real
name description put a "To:" header in the fourth parameter.
mail("[EMAIL PROTECTED]", "the subject", "test",
"To: Danya <[EMAIL PROTECTED]>\r\n"
."From: [EMAIL PROTECTED]"
."Reply-To: [EMAIL PROTECTED]"
."X-Mailer: PHP/" . phpversion());
Previous Comments:
------------------------------------------------------------------------
[2003-03-21 05:18:14] dbakr at evalica dot com
mail("Danya <[EMAIL PROTECTED]>", "the subject", "test",
"From: [EMAIL PROTECTED]"
."Reply-To: [EMAIL PROTECTED]"
."X-Mailer: PHP/" . phpversion());
results of running scripts
Warning: mail() [function.mail]: SMTP server response: 501 >: "@" or
"." expected after "Danya" in c:\app\apache\html\smail\test.php on line
6
this error message caused by mail() function's adding additional <>
symbols to "Danya <[EMAIL PROTECTED]>".
resulting email addres that was sended to smtp server was "<Danya
<[EMAIL PROTECTED]>>". Of course, server generates error :)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22812&edit=1