Doc #52850 [Opn->Wfx]: The documentation is not clear enough
| From: | aharvey@php.net | Date: | Wed, 15 Sep 2010 09:42:32 +0000 |
| Subject: | Doc #52850 [Opn->Wfx]: The documentation is not clear enough | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5048@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52850&edit=1
ID: 52850
Updated by: aharvey@php.net
Reported by: ak at ilk dot net
Summary: The documentation is not clear enough
-Status: Open
+Status: Wont fix
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
New Comment:
The second note within the additional_headers parameter seems to cover
this already -- \r\n is the correct end of line for mail headers, and
any MTA that provides a sendmail interface that can't cope with that is
broken.
Previous Comments:
------------------------------------------------------------------------
[2010-09-15 11:30:20] ak at ilk dot net
Description:
------------
In the documentation to the mail function the handling of the chars \r
and \n are misleading.
The explanation from Ben Cooke in the comments is very clear. Link to
the comment: http://de.php.net/manual/en/function.mail.php#59773
It would be great to find the explanation in the doc directly. Which
would help others to find this information faster.
Here is the comment:
Note that there is a big difference between the behavior of this
function on Windows systems vs. UNIX systems. On Windows it delivers
directly to an SMTP server, while on a UNIX system it uses a local
command to hand off to the system's own MTA.
The upshot of all this is that on a Windows system your message and
headers must use the standard line endings \r\n as prescribed by the
email specs. On a UNIX system the MTA's "sendmail" interface assumes
that recieved data will use UNIX line endings and will turn any \n to
\r\n, so you must supply only \n to mail() on a UNIX system to avoid the
MTA hypercorrecting to \r\r\n.
If you use plain old \n on a Windows system, some MTAs will get a little
upset. qmail in particular will refuse outright to accept any message
that has a lonely \n without an accompanying \r.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52850&edit=1