note 73355 added to function.mail
| From: | andy at andybev dot com | Date: | Mon, 19 Feb 2007 12:56:50 +0000 |
| Subject: | note 73355 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123575@lists.php.net to get a copy of this message | ||
I'm copying Ben Cooke's note from the main mail page into here because I didn't find
it initially. The issue described below caused me a lot of problems because of Postfix converting a
single \r\n into double new lines, resulting in corrupted mail.
=====================================================
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.
----
Server IP: 83.138.144.80
Probable Submitter: 87.127.97.18 (proxied: 10.0.14.250)
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/73355
Del: integrated -- https://master.php.net/note/delete/73355/integrated
Del: useless -- https://master.php.net/note/delete/73355/useless
Del: bad code -- https://master.php.net/note/delete/73355/bad+code
Del: spam -- https://master.php.net/note/delete/73355/spam
Del: non-english -- https://master.php.net/note/delete/73355/non-english
Del: in docs -- https://master.php.net/note/delete/73355/in+docs
Del: other reasons-- https://master.php.net/note/delete/73355
Reject -- https://master.php.net/note/reject/73355
Search -- https://master.php.net/manage/user-notes.php