Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mail sending failed using java mail api

 
Sidhartha Ray
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic