File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes how to add datahandler class for  text/HTML  mimetype Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "how to add datahandler class for  text/HTML  mimetype" Watch "how to add datahandler class for  text/HTML  mimetype" New topic
Author

how to add datahandler class for text/HTML mimetype

Darshan Bhavsar
Greenhorn

Joined: Dec 06, 2001
Posts: 26
Hello friends
I have one problem regarding sending HTML page.
I know it's syntext
MimeMessage msg = new MimeMessage(session)
msg.setContent(MultiPart M,"text/HTML");
But it is giving me error of Not installing datahandler for text/HTML
how to add datahandler class for text/HTML mimetype
Thanks in advance
Anand Vasan
Greenhorn

Joined: Apr 11, 2002
Posts: 4
Hi,
I am also looking same thing so if u have any updates let me know. my question is Embedding hypertext link in e-mail using java.mail
Thanks
Darshan Bhavsar
Greenhorn

Joined: Dec 06, 2001
Posts: 26
hello anand
I found the solution of Datahandler that is surely help to u.I send u some snippet .
try this
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(msgText1+msgText2, "text/html");
// Create a related multi-part to combine the parts
MimeMultipart multipart = new MimeMultipart();
// Add body part to multipart
multipart.addBodyPart(messageBodyPart);
// Associate multi-part with message
msg.setContent(multipart);
// Send message
Transport.send(msg);
I hope this helps u if not send me mail my id is
dmb@atul.co.in and inform me this helps u or not
 
 
subject: how to add datahandler class for text/HTML mimetype
 
Threads others viewed
javax.mail.internet.AddressException: Illegal address in string ``'' error
use javamail to send html email
Issue with Copy and Paste from external source to applet.
java mail and text/plain
How to embed image (relative path) in an HTML e-mail?
IntelliJ Java IDE