How do you encode a carriage return in Java-gen'd string that becomes body of "text/plain" mail sent via JavaMail?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sara_Taylor
Posted On:   Tuesday, November 19, 2002 10:02 AM


I'm using Java to dynamically generating text strings which become the body of "text/plain" emails sent via JavaMail. How do I encode a carriage return or line feed in these strings to produce line breaks when the email is viewed by the recipient? FYI: "text/html" mails are prohibited

Re: How do you encode a carriage return in Java-gen'd string that becomes body of "text/plain" mail sent via JavaMail?

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, November 19, 2002 01:42 PM

An ordinary line break char should do.


(depending on the underlying system this could be a linefeed for Unix, or a carriage return for Mac, or a pair of both for MS Windows)


Note that in transmission via SMTP, line breaks in the encoded transmission need to be pairs (carriage return + linefeed). But typically your message body will be encoded by some content-transfer-encoding to protect the internal linebreaks, so they may have no relation to the linebreaks sent in transmission.

About | Sitemap | Contact