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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.