Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Text formatting in MIME message

843830Sep 21 2004 — edited Jan 18 2005
Hello,

I am sending a report as an email using JavaMail that requires fixed width formatting of text. I cannot send this as text/html, it must be sent as plain text.

How do I format the message under "text/plain" to a specific (fixed) font?

Here is what I am using to set the body of the message (they can optionally ask for html, plain text or both):
if (format.isText()) { 
  msg.setText(body); 
  }
if (format.isHtml()) {
    msg.setContent(body,"text/html; charset=\"ISO-8859-1\"");
}
Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2005
Added on Sep 21 2004
4 comments
294 views