ID:               22812
 Comment by:       bobe at phpcodeur dot net
 Reported By:      dbakr at evalica dot com
 Status:           Bogus
 Bug Type:         Mail related
 Operating System: Windows XP
 PHP Version:      4.3.1
 New Comment:

This tips provokes a problem on the Linux servers, the email is twice
received

On Linux, if we put nothing for the first argument of the mail()
function and what we add to in headers them, the email is correctly
received (And a to header empty is added all the same), but it plants
under Windows (SMTP error 554)

So, on the Windows servers, this tips works perfectly.

Then ? Bug or not bug ? :)


Previous Comments:
------------------------------------------------------------------------

[2003-03-22 21:25:03] [EMAIL PROTECTED]

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());




------------------------------------------------------------------------

[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

Reply via email to