This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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!
I agree. Here's the link:
subject: Error while sending email through java.mail
It's not a secret anymore!