note 45413 deleted from ref.mail by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 20:20:57 +0000 |
| Subject: | note 45413 deleted from ref.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155374@lists.php.net to get a copy of this message | ||
Note Submitter: Ivo Fokkema I.Fokkema att LUMC d0ttt nl
----
We have a open source project that needed to be able to function on as many platforms and
configurations as possible. Using '\n' as end-of-line for emailheaders would probably
'break' the email functionality on Windows and Mac platforms.
I have fixed this using the code below. Please note that since I don't have any access to a Mac
server, this setup is not tested on a Mac, but should work.
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$s_eol = "\r\n";
} elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
$s_eol = "\r";
} else {
$s_eol = "\n";
}
(Thanx to Eric Gach on http://www.phpbuilder.com/lists/php-windows/2003032/0057.php
for the inspiration!)
Then construct your headers using
$s_headers = 'From: registrationform@example.org' . $s_eol;
Hope this helps anyone!!!
Ivo