Sending JavaMail through a web application
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   smita_k
Posted On:   Sunday, April 30, 2006 03:47 AM

I have written a test java mail program for SMTP server which works well. It sends the mail correctly on execution. My actual requirement is to send the mail on an event in the web application (in this case, when a new record is added through the application, mail should be sent). I am using the same mail.jar and activation.jar as in the test program, but still it gives me following exception when send mail code is executed through the application: Exception while sending Mail javax.mail.NoSuchProviderException: No provider for SMTP javax.mail.NoSuchProviderException: No provider for SMTP at javax.mail.Session.getProvider(Session.java:436) at javax.mail.Session.getTransport(Sess   More>>

I have written a test java mail program for SMTP server which works well. It sends the mail correctly on execution.

My actual requirement is to send the mail on an event in the web application (in this case, when a new record is added through the application, mail should be sent).

I am using the same mail.jar and activation.jar as in the test program, but still it gives me following exception when send mail code is executed through the application:


Exception while sending Mail javax.mail.NoSuchProviderException: No provider for SMTP
javax.mail.NoSuchProviderException: No provider for SMTP

at javax.mail.Session.getProvider(Session.java:436)
at javax.mail.Session.getTransport(Session.java:631)
at javax.mail.Session.getTransport(Session.java:612)




I have set the debug to true(using session.setDebug(true);), but there is no message from the debug except the following:


DEBUG: setDebug: JavaMail version 1.3.1



Can somebody please point out where the error may be ?




The web application has tomcat 5.0.28 and apache.



Thanks and Regards,

Smita

   <<Less

Re: Sending JavaMail through a web application

Posted By:   methuku_sreedhar  
Posted On:   Tuesday, May 23, 2006 12:39 AM

hi smitha,
my requirement also sending mail thru smtp even i m not getting i m not getting the sending mail also pls can u provide me ur code it is helpfull for me pls send me fast its very urgent i m requesting u.this is my id shree_mca1@yahoo.co.in and sreedhar.methuku@gmail.com

Re: Sending JavaMail through a web application

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, May 7, 2006 09:29 AM

...I am using the same mail.jar and activation.jar as in the test program...


Do you have both jar files in the WEB-INF/lib directory of your web application?

About | Sitemap | Contact