note 94428 modified in function.mail by danbrown
| From: | danbrown@php.net | Date: | Wed, 04 Nov 2009 15:02:20 +0000 |
| Subject: | note 94428 modified in function.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162393@lists.php.net to get a copy of this message | ||
Bare LFs in SMTP
Use This
<?php
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);
?>
--was--
Bare LFs in SMTP
Use This
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);
http://php.net/manual/en/function.mail.php