While building a simple feedback form, I came across what seemed like a puzzling 
error(?) in the manual.

After the user has filled the form I call for the mail() function. To do so, I 
referred to the manual about the mail function: 

"...Please also note that the cc: and bcc: headers are case sensitive and should be 
written as Cc: and Bcc: on Win32 systems."

Since I Am using a Win32 system, and accustomed with the many 'nuances' involved in 
running PHP on Windows, I followed to the letter.

 /* subject and message are arguments returned from the form */
    $headers = "From: Me <[EMAIL PROTECTED]>\r\nCc: [EMAIL PROTECTED]\r\nBcc: 
mail($address, $subject, $message, $headers);

When I ran the script IE repeatedly launched an error message saying the page can't be 
opened, and the connection with the server has been reset. The mail of course wasn't 
sent, as well.
I tried a few different ways to write the headers argument, but none of them worked 
unless I removed the 'cc' and 'bcc' ones. Then finally I gave up, and wrote them case 

    $headers = "cc: [EMAIL PROTECTED]\r\nbcc: [EMAIL PROTECTED]";

To my surprise that worked perfectly, and produced no error at all, despite of the 
explicit warning in the manual.

It really is no biggie, the script Is Working. But it is interesting, as I usually 
assume that on these matters the manual is accurate. I also checked the PHP Manual 
Errata (http://www.php.net/manual/browse-errata.php) , but no one seems to report this 
error before.

I would appreciate it if someone would clear the matter, as it seems very unlikely to 
me that the fault is in the manual, rather than in my system.
I am using Apache 1.3.12 and PHP 4.0.6, on a Win32 (95) system.

   Boaz Amit

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to