scarhand Posted February 22, 2010 Share Posted February 22, 2010 i am using the php mail() function to send a message from a mysql database (text) field the problem is, if the message has text that goes on new lines, etc. then the \r's and \n's show up in the email <?php $email_body = $row['details']; mail("[email protected]", "New Message!", $email_body, "From: [email protected]"); ?> the email looks like this: test a reply\r\n\r\n(working on stuff)\r\nblah blah blah the nl2br function does not help. Link to comment https://forums.phpfreaks.com/topic/192892-message-from-mysql-field-showing-ns-and-rs-in-email/ Share on other sites More sharing options...
ialsoagree Posted February 22, 2010 Share Posted February 22, 2010 You may want to try printing $email_body to see what it contains. I suspect that the special characters might be escape, in which case you'll need to use stripslashes() on it prior to putting it into the e-mail. Can't be sure though, need to see what $email_body contains. Link to comment https://forums.phpfreaks.com/topic/192892-message-from-mysql-field-showing-ns-and-rs-in-email/#findComment-1015950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.