Exception in sending simple smtp message
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vijay_Jadhav
Posted On:   Wednesday, February 20, 2008 06:12 AM

hi I m beginer to JavaMail. I got sample example to send smtp mail from sun's site. I enter all server setting in propery variable according to my smtp server and run code. I am getting following exception: Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/BASE64EncoderStream at javax.mail.internet.MimeMessage.setSubject(MimeMessage.java:793) at javax.mail.internet.MimeMessage.setSubject(MimeMessage.java:757) at MailWithPasswordAuthentication.run(MailWithPasswordAuthentication.java:25) at MailWithPasswordAuthentication.main(MailWithPasswordAuthentication.java:14) Caused by: java.lang.ClassNotFoundException: com.sun.mail.util.BASE64EncoderStream at java.net.URLClassL   More>>

hi
I m beginer to JavaMail. I got sample example to send smtp mail from sun's site. I enter all server setting in propery variable according to my smtp server and run code. I am getting following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/BASE64EncoderStream
at javax.mail.internet.MimeMessage.setSubject(MimeMessage.java:793)
at javax.mail.internet.MimeMessage.setSubject(MimeMessage.java:757)
at MailWithPasswordAuthentication.run(MailWithPasswordAuthentication.java:25)
at MailWithPasswordAuthentication.main(MailWithPasswordAuthentication.java:14)
Caused by: java.lang.ClassNotFoundException: com.sun.mail.util.BASE64EncoderStream
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
Please help me.

   <<Less

Re: Exception in sending simple smtp message

Posted By:   Anonymous  
Posted On:   Wednesday, February 27, 2008 03:07 PM

You don't have the right jar file installed. There are two different ones, one that just has the api (javax.* classes) and one that includes com.sun classes that you need to actually have a working javamail installation.
About | Sitemap | Contact