marcoo Posted February 24, 2004 Share Posted February 24, 2004 My email, comming from online PHP form, lost all newline characters. It happend after I added additional header for PHP mail() call, like this one: MIME-Version: 1.0\nContent-type: text/html; charset=utf-8 How can I get newline characters back? Thanks. Link to comment Share on other sites More sharing options...
0 Gism0 Posted February 25, 2004 Share Posted February 25, 2004 i think that's because it's expecting HTML, you could replace "\n" with "<br />" just before you send it.. Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted February 25, 2004 Veteran Share Posted February 25, 2004 <?PHP $message=str_replace("\n","<br>",$msg); ?> Something like that? Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted February 25, 2004 Veteran Share Posted February 25, 2004 heh -looks like we found a small bug in IVB :) the second set of "" should have a <br> in it but IVB takes it literally. Link to comment Share on other sites More sharing options...
0 epton Posted February 25, 2004 Share Posted February 25, 2004 send as plaintext. or use nl2br() if you want html. Link to comment Share on other sites More sharing options...
0 marcoo Posted February 25, 2004 Author Share Posted February 25, 2004 It works with $message = str_replace("\n", "<br />",$msg); Thanks a lot, guys. Link to comment Share on other sites More sharing options...
0 Kilroy-was-here Posted February 25, 2004 Share Posted February 25, 2004 heh -looks like we found a small bug in IVB :) the second set of "" should have a <br> in it but IVB takes it literally. Well, report it to Invision ;) Link to comment Share on other sites More sharing options...
Question
marcoo
My email, comming from online PHP form, lost all newline characters.
It happend after I added additional header for PHP mail() call, like this one:
MIME-Version: 1.0\nContent-type: text/html; charset=utf-8
How can I get newline characters back?
Thanks.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts