jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes how to  pass html code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to  pass html code " Watch "how to  pass html code " New topic

how to pass html code

Amit Ranjan

Joined: Jun 25, 2001
Posts: 3
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
Ranch Hand

Joined: May 07, 2001
Posts: 57
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.
Of if you would prefer a tutoral, here is JGuru's JavaMail tutorial. It Explains sending HTML messages.
Jayson Falkner

Jayson Falkner<br />jayson@jspinsider.com<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: how to pass html code
It's not a secret anymore!