dweb Posted May 25, 2012 Share Posted May 25, 2012 Hi I have written a very simple online email script, which reads my mailbox and lists all emails in it. To do so i'm using imap_open() everything is working fine to output the body text of an email i'm using $bodytxt = imap_fetchbody($mbox, 100, "1"); echo $bodytxt; which correctly outputs the email text, apart from retaining of line breaks. so I applied echo nl2br($bodytxt); and line breaks were successfully added, but for some reason it is creating random line breaks at points where one didn't exist in the email. if I try sending an email which has no line breaks, such as xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx then when I view that via my php script, it outputs xxxxxxxxxxxxxxxxxxxxxx<br /> xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx<br /> xxxxxxx and this happens if the email is sent as HTML or as Plain text any idea what could be going on? thanks Quote Link to comment https://forums.phpfreaks.com/topic/263097-formatting-output-issue/ Share on other sites More sharing options...
dweb Posted May 25, 2012 Author Share Posted May 25, 2012 any idea? Quote Link to comment https://forums.phpfreaks.com/topic/263097-formatting-output-issue/#findComment-1348548 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.