ID: 20625 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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("[EMAIL PROTECTED]", "the subject", "From then on", "From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion()); ?> ------------------------------------------------------------------------ [2002-11-25 17:56:51] [EMAIL PROTECTED] This is not bug in PHP but in your code..please ask support elsewhere. ------------------------------------------------------------------------ [2002-11-25 12:58:31] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] * 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 <[EMAIL PROTECTED]>\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