Windows mail() problem with newlines
| From: | Don Sutherland | Date: | Thu, 12 Dec 2002 21:31:43 +0000 |
| Subject: | Windows mail() problem with newlines | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128070@lists.php.net to get a copy of this message | ||
I have found what looks to be a problem with the php mail() function
and string in the message body with \n newlines in them.
using the following piece of code to test
<?php
$msg = "Hello\nWorld";
$to = "email address removed";
$subj = "Testing 1 2 3 ...";
$s = mail($to, $subj, $msg);
print "Res: $s";
?>
generates the following output
Warning: Server Error in d:\apache\htdocs\mailtest.php on line 8
Res:
If I change $msg to
$msg = "Hello World";
the message goes through fine and the only output is "Res: 1" as it should
be.
Has anyone else run into this and know a solution, or can atleast verify it.
I've seen it on 2 different windows 2000 machines running the same
versions of php and apache, as well as connecting to 2 different smtp
servers.
Environment
Window 2000
Apache 1.3.27
PHP 4.2.3
Thanks
Don