Jump to content

Formatting output issue


dweb

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/263097-formatting-output-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.