| Author |
mail sending failed using java mail api
|
Sidhartha Ray
Greenhorn
Joined: Jul 04, 2012
Posts: 22
|
|
Hi all,
I'm using Java mail API for sending mail with some zip file attachments.
It's working fine, but one issue : when one autherisation fails then the subsequent mail sending also fails.
i.e., say one email id/password is wrong, then it throws javax.mail.AuthenticationFailedException, and after that even though the mail id/password is correct, then also same exception thrown
Any suggestion ???
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Try not using the same connection for the second user ID.
(You should realize that I'm just making a guess here. If you want help which is not based on guesswork, then you should post the code which is having the problem.)
|
 |
Sidhartha Ray
Greenhorn
Joined: Jul 04, 2012
Posts: 22
|
|
Thanks Paul !
That problem has been solved.
Previously I was using :
Session session = Session.getDefaultInstance(props, authenticator);
for creating session, but when I changed that to,
Session session = Session.getInstance(props, authenticator);
that problem is solved..
But, I could not understand the reason for that. Any suggestion ???
|
 |
 |
|
|
subject: mail sending failed using java mail api
|
|
|