jesushax Posted November 27, 2008 Share Posted November 27, 2008 Hi, Im sending email in html format but instead of a line break im getting \r\n here are my mail headers $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers ive tried doing a str_replace but it didnt work. Any ideas? Thankyou Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/ Share on other sites More sharing options...
Adam Posted November 27, 2008 Share Posted November 27, 2008 str_replace() on what? Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/#findComment-700323 Share on other sites More sharing options...
jesushax Posted November 27, 2008 Author Share Posted November 27, 2008 well the text that shows the \r\n is grabbed from a form so i used <td>".str_replace("\r\n","<br />",$Desc)."</td> this didnt work Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/#findComment-700327 Share on other sites More sharing options...
DarkWater Posted November 27, 2008 Share Posted November 27, 2008 Use nl2br(). Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/#findComment-700413 Share on other sites More sharing options...
jesushax Posted November 28, 2008 Author Share Posted November 28, 2008 that didnt work either Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/#findComment-700868 Share on other sites More sharing options...
jesushax Posted November 28, 2008 Author Share Posted November 28, 2008 figured it out, was becuase i was doing a mysql_escape_string on it and the doing a str_replace on it i just did the str_replace on the posted data and i works Link to comment https://forums.phpfreaks.com/topic/134495-solved-html-email-line-breaks-rn/#findComment-700884 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.