Hi,
The documentation for the mail() function (http://uk.php.net/manual/en/ref.mail.php) states:
If a fourth string argument is passed, this string is inserted at the end of the header. This is typically used to add extra headers. Multiple extra headers are separated with a carriage return and newline.
Note: You must use \r\n to separate headers, although some Unix mail transfer agents may work with just a single newline (\n).
In my experience this is wrong. In particular on hosts running Linux or BSD and Postfix (i.e. LOTS!!), using \r\n will cause mail headers to be displayed in the message body when received by clients running Outlook and Outlook Express on Windows.
When running on a non-windows host, \n should be used to separate headers.
The PEAR mail library (http://pear.php.net/package/Mail) does it this way when sending using the mail() function - see line 57 from Mail-1.1.4/Mail/mail.php:
$this->sep = (strstr(PHP_OS, 'WIN')) ? "\r\n" : "\n";
A bug appears to have been raised for this (http://bugs.php.net/bug.php?id=15841).
I and php developers the world over would be eternally grateful if the manual could be changed - it has caused me many hours of needless work.
Regards,
Colin Brown.
