note 107075 deleted from function.mail by danbrown

From: Date: Fri, 06 Jan 2012 19:16:55 +0000
Subject: note 107075 deleted from function.mail by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185412@lists.php.net to get a copy of this message
Note Submitter: jlunda at live dot com ---- 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.

« previous php.notes (#185412) next »