File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Error while sending email through java.mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Error while sending email through java.mail" Watch "Error while sending email through java.mail" New topic

Error while sending email through java.mail

rahamath basha

Joined: Oct 20, 2004
Posts: 1
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
at javax.mail.Session.loadProvidersFromStream(
at javax.mail.Session.access$0(
at javax.mail.Session$1.load(
at javax.mail.Session.loadResource(
at javax.mail.Session.loadProviders(
at javax.mail.Session.<init>(
at javax.mail.Session.getDefaultInstance(
at SendEmail.SendMessage(
at SendEmail.main(
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

In order to use JavaMail you need to include the JavaMail jar (mail.jar) in your classpath. Its got all the implementing classes (including com.sun.mail.util.LineInputStream) - if you have done this, check you mail.jar is not corrupt.
[ October 20, 2004: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Moving this to the "Other API's" forum where they discuss Java Mail quite often.

Please post your replies there, thanks!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Error while sending email through java.mail
jQuery in Action, 3rd edition