note 39727 added to function.mail
| From: | php-general at lists dot php dot net | Date: | Mon, 09 Feb 2004 01:40:24 +0000 |
| Subject: | note 39727 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64852@lists.php.net to get a copy of this message | ||
When adding extra headers, be sure to enclose the line endings \r\n in double quotes ("), not
single quotes (').
Something about the single quotes seems to force the r and n to be taken literally, instead of
producing the newlines as they should. As a result, your additional headers get messed up. Replacing
them with double quotes solves the problem.
So:
"From: Name <name@example.com> \r\n"
.'X-Sent-By: PHP webserver'
NOT
'From: Name <name@example.com> \r\n'
.'X-Sent-By: PHP webserver'
(this was on Mac OS 10.3.2 running PHP 4.3.4 and the built-in postfix sendmail replacement)
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39727
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39727&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39727&report=yes
Search -- http://master.php.net/manage/user-notes.php