aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Email cound not be sent in web app 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 "Email cound not be sent in web app" Watch "Email cound not be sent in web app" New topic
Author

Email cound not be sent in web app

Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
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

Joined: Oct 13, 2011
Posts: 119
I got the following exception:

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

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

Joined: Oct 13, 2011
Posts: 119
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Email cound not be sent in web app