• Post Reply Bookmark Topic Watch Topic
  • New Topic

Html Format Mail

 
varun bihani
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to send mail in html format. i am using java mail api.
but i am getting this error for my programe.
Can nebody tell me how to send mail in html format
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/SharedByteArrayInputStream
at email_test.main(email_test.java:90)

I think problem is somewhere in this part of code..
InternetAddress internetaddress = new InternetAddress("info@chemicalhouse.com");
InternetAddress internetaddress1 = new InternetAddress("edward@galaxyweblinks.com");
MimeMessage mimemessage = new MimeMessage(session);
mimemessage.setFrom(internetaddress);
mimemessage.setRecipient(javax.mail.Message.RecipientType.TO, internetaddress1);
mimemessage.setSubject("Posting Mail");
mimemessage.setContent(subject, "text/html");
Transport.send(mimemessage);
 
Gary VanMatre
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you need to include the activation framework in your classpath. I believe the Sun J2EE sdk bundles the mail api and activation framwork in the j2ee.jar archive. IBM packages it in separate jar file (mail.jar, activation.jar).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!