note 107075 added to function.mail
| From: | jlunda at live dot com | Date: | Thu, 05 Jan 2012 06:27:49 +0000 |
| Subject: | note 107075 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185369@lists.php.net to get a copy of this message | ||
To add to tschmieder's note about the use of the PHP_EOL constant being multiplatform:
I tested the mail function on the following code:
<?php
echo "Upon opening this page, a message should be sent.";
$message = "This is now a test of a message that will certainly be longer than 70
characters." . PHP_EOL;
$message = wordwrap($message, 70, PHP_EOL);
mail("person@example.com", "This is a test", $message, "From:
webmaster@example.com" . PHP_EOL);
?>
Be sure that if you are going to send a message longer than 70 characters (and if you are going to
use wordwrap() to fix this) that you specify the break to be used as PHP_EOL. I had the most
difficult time with this on a Windows host and want to spare others some trouble.
----
Server IP: 64.71.164.2
Probable Submitter: 184.38.96.71
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/107075
Del: integrated -- https://master.php.net/note/delete/107075/integrated
Del: useless -- https://master.php.net/note/delete/107075/useless
Del: bad code -- https://master.php.net/note/delete/107075/bad+code
Del: spam -- https://master.php.net/note/delete/107075/spam
Del: non-english -- https://master.php.net/note/delete/107075/non-english
Del: in docs -- https://master.php.net/note/delete/107075/in+docs
Del: other reasons-- https://master.php.net/note/delete/107075
Reject -- https://master.php.net/note/reject/107075
Search -- https://master.php.net/manage/user-notes.php