Exception in thread "main"....in JavaMail demo program
Hi,
As per Readme file of "javamail-1.4" , I compiled msgsh'ow.java successfully, but when I' running it by executing "java msgshow -" or java -classpath . mshshow -", it gives me error:
Exception in thread "main" java.mail.NoClassDefFoundError: javax/mail/MessageException.
Please help me in resolving it.
Thanks in advance,
Rajeev.
Your CLASSPATH needs to contain three things:
1. The full pathname of mail.jar.
2. The full pathname of activation.jar.
3. The directory where you compiled msgshow.java.
If you compiled successfully you must've set CLASSPATH properly
but apparently something you're doing is causing that setting not to
be seen when you run the program using the "java" command.
Though this part is resolved, when I try to send mail to hotmail, I get following error:
Exception in thread "main" java.lang.ClassCastException: java.net.UnknownHostException
I have coded following for 'put':
...
props.put ("mail.smtp.host", "mail.hotmail.com");
....
Please help me out....
Thanks in advance
Rajeev