note 67903 deleted from ref.mail by bjori
| From: | bjori@php.net | Date: | Thu, 06 Jul 2006 11:17:11 +0000 |
| Subject: | note 67903 deleted from ref.mail by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-114501@lists.php.net to get a copy of this message | ||
Note Submitter: szymon[at]e-webdesign[d]pl
Reason: 5
----
I've just resolved a problem with sending email using mail(); (mail not sent). The problem was
\n at the end of the header or headers. Ie. this didn't work:
<?php
$headers .= "X-Sender: NAME <noreply@host.pl>\n";
$headers .="From: NAME <noreply@host.pl>\n";
?>
I changed it to...
<?php
$enter = chr(13) . chr(10);
$headers .= "X-Sender: NAME <noreply@host.pl>".$enter;
$headers .="From: NAME <noreply@host.pl>".$enter;
?>
and now it works :-) I hope this will help someone.