note 48512 deleted from function.mail by tularis

From: Date: Mon, 27 Dec 2004 20:02:08 +0000
Subject: note 48512 deleted from function.mail by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82359@lists.php.net to get a copy of this message
Note Submitter: brent at nirus dot net ---- To solve my \r\n problem using Windows server 2003 and Alt-N Daemon For mail server on same system. All I had to do was first make sure that I could relay and send without authentication on my LAN or 127.0.0.1. Then: // this sends the correct headers to the mail server $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; //But the entire $message was still on one line with no carraige returns so... $message = str_replace(Chr(13), "<br>", $message); mail(mymail@domain.com, $subject, $message, $headers); Also, I was trying to get all the mail that was sent into a database. I was using the following to prevent SQL injection... this is not good for the mail headers! So If you are wanting to use the real escape then specify this after you send mail or give the variable another name $subject=mysql_real_escape_string($_POST['subject']); - Brent Russell

« previous php.notes (#82359) next »