This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email cound not be sent in web app

 
Haina Minawa
Ranch Hand
Posts: 119
  • 0
  • 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
Pie
Posts: 2493
7
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the following exception:

 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • 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
  • 0
  • 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