This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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 /><br />Author of <a href="" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
Don't get me started about those stupid light bulbs.
subject: how to pass html code
Similar Threads
Undefined on jQuery Ajax Request
How to create ConfirmServlet using a JavaMail / Servlet Mechanism?
How to parse the content(mail body) of email using java mail API
how to print values of a list
Submit dynamically created form using jQuery Form plugin