This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I send HTML mail?  RSS feed

 
senthil raja
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i send mail in html format from jsp.
please can any one help me.
Thanks
Senthil
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't. A LOT of mail readers don't like it, including Lotus Notes. At best, it requires extra effort and overhead to view. At worst, it may be unreadable.
Forget that. AT WORST, some twerp will hack it to carry a virus payload.
HOWEVER. If you MUST, just create the HTML the same way you would if you were writing it to a text file.
 
Tom Diamond
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that a message header must be set to type "text/html" too. But I am not sure, anyway ...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this was a more basic question
Use the JavaMail API.
Kyle
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ignore people who try to tell you what to do without knowing anything about your needs and motivations.
Kyle is right in that this is not a simple question. Read up on the JavaMail API and RFC 2557.
The following is a good resource:
http://www.zvon.org/tmRFC/RFC2557/Output/chapter9.html
To be friendly to non-HTML capable mail readers, you can send a multi-part message that contains the body in two parts: plain text for simple mail clients, and HTML for more capable clients.
hth,
bear
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!