#20625 [Bgs]: Mail Function output displaying '>' before the word From

From: Date: Tue, 26 Nov 2002 10:40:46 +0000
Subject: #20625 [Bgs]: Mail Function output displaying '>' before the word From
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-25841@lists.php.net to get a copy of this message
ID: 20625 Updated by: derick@php.net Reported By: sarah@perceptiondesign.net Status: Bogus Bug Type: *Mail Related Operating System: Free BSD PHP Version: 4.2.0 New Comment: It has to do with the unix mailbox format. "From " at the beginning of a line is the seperator for emails in such a box, and to make sure normal lines with "From " at the beginning of a line are prefixed with a ">". Derick Previous Comments: ------------------------------------------------------------------------ [2002-11-26 04:37:45] sarah@perceptiondesign.net I have tried taking the new line breaks out of my previous code but am still getting the same result. I have taken the code below from phpbuilder.com and put in my email address and the message "From then on" and the output was the same: >From then on <?php mail("sarah@perceptiondesign.net", "the subject", "From then on", "From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion()); ?> ------------------------------------------------------------------------ [2002-11-25 17:56:51] sniper@php.net This is not bug in PHP but in your code..please ask support elsewhere. ------------------------------------------------------------------------ [2002-11-25 12:58:31] iliaa@php.net Your code has a slight problem that I see, the 'From:' header contain a newline between the name & the email, that may cause problems for your code. ------------------------------------------------------------------------ [2002-11-25 10:59:42] sarah@perceptiondesign.net * PHP version is actually 4.1.2 but Server is hosted with NTT/Verio so unable to update PHP version I am testing my mail function where a user enters their subject and message on a form and the next page pulls emails from a database and mails out to everyone. When I put the word From in the message box in the format From.. or From then on.. or From Sat 16th. it displays a '>' before the word From like this >From then on.. It doesn't do this with lower case from or upper case. It is ok when you insert a space before writing From. I thought it might be getting mixed up with the From tag. My code is this: <?php echo "Emails have been sent to the following people: <br><br>"; $header = "From: Blair Drummond Safari Park <info@blairdrummond.com>\n"; $header .= "Content-Type: text/html\n"; $db = mysql_connect("localhost", "******", "******"); mysql_select_db("******",$db); $result = mysql_db_query("******","select * from consumers where email<>'' and email <> ' ' and mailing<>-1"); while ($row = mysql_fetch_array($result)) { echo $row["email"]." (".$row["first_name"]." ".$row["surname"].") "; mail($row["email"],$subject,$message,$header); } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20625&edit=1

« previous php.bugs (#25841) next »