sKunKbad Posted November 26, 2007 Share Posted November 26, 2007 I've got a script that sends mail based on quiz answers that are stored in an xml file. The answers have \n newline characters in them, which I convert to <br /> before generating the HTML portion of a multipart email. I was experiencing problems using str_replace to replace all of the \n with <br /> , but nl2br works fine. What is strange is, when using str_replace, I can check the value of the converted string with echo and it looks just as I want, but the mail() function won't accept the string, and mail() fails. Using nl2br works great. I just want to know why the string generated by str_replace isn't accepted by the mail function. Quote Link to comment https://forums.phpfreaks.com/topic/78871-nl2brstring-vs-str_replacenstring-before-using-mail/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.