hongjun
asked on
JavaMail
I am using J2EE.
Anyone can provide sample codes using JavaMail to send an email?
hongjun
Anyone can provide sample codes using JavaMail to send an email?
hongjun
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
exmaple codes available here....
http://alumnus.caltech.edu/~croft/research/java/mail/
http://java.sun.com/products/javamail/
http://alumnus.caltech.edu/~croft/research/java/mail/
http://java.sun.com/products/javamail/
ASKER
I got NoClassDefFoundError.
I am suspecting my classpath is incorrect for javamail.
hongjun
I am suspecting my classpath is incorrect for javamail.
hongjun
ASKER
BTW, I have included activation.jar and mail.jar but still not working.
I am using this code
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
I am using this code
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
Which class is not being found? The mail ones or the main class? Have you checked the package declaration?
ASKER
Thanks I got it to work.
However, I do have some queries.
The code example shows that you just need to include a smtp server address. However, username and password are omitted. I would prefer to enter them. Can help?
hongjun
However, I do have some queries.
The code example shows that you just need to include a smtp server address. However, username and password are omitted. I would prefer to enter them. Can help?
hongjun
ASKER
How to set a classpath in NetBeans?
It doesn't seem to be able to compile using netbeans because of classpath problem.
hongjun
It doesn't seem to be able to compile using netbeans because of classpath problem.
hongjun
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If it's anything like Eclipse, right click on the project and select Java/build Path/ add jars
>> How to set a classpath in NetBeans?
In netBeans you have to mount a jar to make it "available"
Thanks for accepting
In netBeans you have to mount a jar to make it "available"
Thanks for accepting
http://www.keysolutions.com/ServletFAQ.nsf/0/99abc10529dab92a8525686700737ea2?OpenDocument
also suns faq on javamail
http://java.sun.com/products/javamail/FAQ.html