chr(13) is lost on mail retrieval

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kalikaye
Forum Newbie
Posts: 3
Joined: Thu Sep 21, 2006 4:18 am

chr(13) is lost on mail retrieval

Post by kalikaye »

I am working on a pop3 client program using PHP and its imap group of functions. I am able to download my email but the body of the text loses all the enter keys and the message shows as continuous lines.

My code simply refers to the $msg["body'] as a whole and this is retrieved using either the imap_fetchbody, imap_base64 or the imap_qprint functions. How can I tell these functions to retain the enter keys in the emails the way I see them in my email server.

Thanks all!
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

If, by 'Enter Key', you mean CRLF (carriage return/line feed) characters, you may be looking for nl2br although I'm not certain how/if it works with the imap_ functions.
Post Reply