This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Cant Send html file through email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "Cant Send html file through email " Watch "Cant Send html file through email " New topic

Cant Send html file through email

Kajol Shroff
Ranch Hand

Joined: Dec 04, 2000
Posts: 160
Hi Everyone,
I am able to send the mail but the mail is comming as a text/plain message whereas actually it is complete html code. I know I should set the content type as text/html but dont know where is the ContentType class or the MIME header class.
I saw the package and in that the ContentHandler class, but this has a getContent() which takes a URL as parameter. So its of no help as such.
Can you let me know how do I resolve this problem
Ranch Hand

Joined: Jul 06, 2001
Posts: 54
The only one difference between plain text and html is the way it is interpreted, unless you tell me that the html tags disappear en route (which is impossible).

Omar IRAQI Houssaini
Kajol Shroff
Ranch Hand

Joined: Dec 04, 2000
Posts: 160
Hi Omar,
I didnt get u? See its not dissapearing. I want to know where do I insert the ContentType. Which package should I import and which class.
[ July 02, 2002: Message edited by: Kajol Shroff ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63202

Are you using the JavaMail API to create/send your e-mail?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Have you checked out Aspose?
subject: Cant Send html file through email
It's not a secret anymore!