my dog learned polymorphism*
The moose likes Other JSE/JEE APIs and the fly likes Problem with sending mail thorugh java api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem with sending mail thorugh java api" Watch "Problem with sending mail thorugh java api" New topic

Problem with sending mail thorugh java api

ashwini kalmath

Joined: Oct 24, 2011
Posts: 25

i am generating email and sending it . it runs fine in development mode. but i get an error in deployment mode ....


at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(

Please help me out.

thank you
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Remove these three lines and then try

Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

Nowadays there is no need to mess about with socket factories when you want to use JavaMail and Gmail to send your e-mail. Have a look at what the JavaMail FAQ says about that.
I agree. Here's the link:
subject: Problem with sending mail thorugh java api
Similar Threads
how to send mail using gmail server
Unable to send mail through mail api
Sending mail thru JAVA
Attachment in email not working in server
SecurityException while sending to gmail from javamail