• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

send mail

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic