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.

[372 byte] By [Rajeev.Asthanaa] at [2007-10-2 20:44:19]
# 1

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.

bshannona at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Is there a better way where one need not worry about setting CLASSPATH?
Rajeev.Asthanaa at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
You can put mail.jar and activation.jar in the jre/lib/ext directory underyour JDK installation.
bshannona at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

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

Rajeev.Asthanaa at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Your machine doesn't know about the host name "mail.hotmail.com".Follow the connection debugging hints here: http://forum.java.sun.com/thread.jspa?forumID=43&threadID=713643
bshannona at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Can someone tell me what to 'put' for SMTP hotmail.com.....
Rajeev.Asthanaa at 2007-7-13 23:27:46 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...