aspose file tools*
The moose likes Servlets and the fly likes send mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "send mail" Watch "send mail" New topic
Author

send mail

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i have been trying to send html page in mail but the problem is - its sending the mail in text format i.e., it is sending all html code in the mail not exactly the html page.
help me out to solve my problem, to send html page not its code.
Mirko Froehlich
Ranch Hand

Joined: Aug 21, 2000
Posts: 114
What exactly do you mean by an HTML page as opposed to its code? An HTML page consists only of HTML code. Just because some email clients render this and you don't see the HTML tags this is still what the page consists of. Or maybe I completely misunderstood you... ;-)
-Mirko
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Krishna Kanth:
i have been trying to send html page in mail but the problem is - its sending the mail in text format i.e., it is sending all html code in the mail not exactly the html page.

From the sound of it your problem is not that you're sending the wrong thing, but just the fact that you don't instruct the mail reader software to interpret the contents as HTML. In other words you either don't set a Content-Type header or the Content-Type is set to text/plain.
Try setting the Content-Type header to text/html.
Often, to support older mail clients, both HTML and plain text versions of the mail are sent out in a multi-part Mime message.
See RFC1521 for more information about all of this. See also the methods and classes javax.mail.internet.MimeMessage.setContentType(), javax.mail.internet.MimeMultipart, javax.mail.internet.MimeBodyPart.setContentType().
- Peter

[This message has been edited by Peter den Haan (edited February 01, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: send mail