I have written a program using javamail to send email.
When i run it as a standalone program, it works and sends email.
But, when i instantiate this class in my
java program and call its method to send email,
it gives me
java.lang.NoClassDefFoundError: javax/mail/Message
I have mail.jar and activation.jar in the classpath.
My doubt is, why is it executing as a stand-alone program only?
Please help.