File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 /><br />Author of <a href="" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
I agree. Here's the link:
subject: how to pass html code
It's not a secret anymore!