Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

how to add datahandler class for text/HTML mimetype

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic