• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email cound not be sent in web app

 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I have some code that sends out an email from GMail. It is working on a command line program but it does not work in a Servlet. It throws an exception saying something like AuthenticationException.
But I double checked the code, it is almost the same for both command line program and Servlet. I don't understand why it behaves so strangely!

Any idea?

Thanks.
 
Tim Moores
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to advise about this without seeing the full stack trace or the code that causes it. For starters, make sure you#re doing things exactly as described in http://www.oracle.com/technetwork/java/faq-135477.html#gmail
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the following exception:

 
Paul Clapham
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would set JavaMail's debug mode on and send an e-mail in both environments: the one where authentication is successful and the one where it fails. See what is different.
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I would set JavaMail's debug mode on and send an e-mail in both environments: the one where authentication is successful and the one where it fails. See what is different.


Thanks, I will try in the debug mode then let you know.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic