• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to show proper mail contant

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body ,

I am creating a mail sending application in jsf.There I am using StringBuffer for mail body .But I am not able to bold , proper indentation ,on my mail content .

How could I do that ? Should I use some 3rd party jar or java provides its own mail body formatting tool ?

ragards,
S
 
Smitha H Rao
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use xslt mail template file to generate the mail. Then you can supply the contents of the mail in xml and dynamically generate formatted mail.

 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally, email was straight, simple text, with no fancy fonts, colors, bold/italic or anything. Just Text.

However, Microsoft Outlook popularized an alternative form of email MIME-formatted as HTML. Basically, it turned your email body into a web page. And caused no end of grief. Among other offences, it allowed malware to be piggybacked in along with the text.

Including the fact that not all mail recipients could properly display HTML email, including at least some versions of IBM's Lotus Notes.

It's still considered polite to check with recipients before sending HTML-format mail. For universal acceptability, plain text is best.
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply .

I want to post HTML message like body .How could I do this ?


regards,
S
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Set the MIME type in the JavaMail envelope to "text/html".

2. Write the mail body in HTML format. You can do this manually or you can use a templating system like XSLT (as Smitha says), or Velocity. Or whatever text-generating system you prefer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!