Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pass html code

 
Amit Ranjan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to pass html code while mailing.So that when the user recieves the mail he/she should view the html page rathar than seeing the html code.I am using java mail and i am reading data
from a html file and mailing the whole data read by the html file.But when i open my email i see the html code rathar than seeing the html page.How can i make the user see html page.Please help
 
Jayson Falkner
Author
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An email message may define the type of content it contains in addition to the content itself. To display HTML you must say hey, the content is HTML. This is accomplished by setting the appropriate MIME type of the message's content.
A very easy way to do this via JSP is by using a set of tag libraries that already supports the functionality.
http://www.jspinsider.com/jspkit/javamail/jspkit_javamail.html
Of if you would prefer a tutoral, here is JGuru's JavaMail tutorial. It Explains sending HTML messages.
http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
Jayson Falkner
jayson@jspinsider.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic