This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Need Help with JavaMail program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Need Help with JavaMail program" Watch "Need Help with JavaMail program" New topic
Author

Need Help with JavaMail program

nik Aggarwal
Greenhorn

Joined: Dec 31, 2010
Posts: 2
Hello,
I am trying to send a mail through jsp to a gmail account.

index.jsp




sendMail.jsp



error
javax.servlet.ServletException: javax.mail.AuthenticationFailedException: failed to connect, no password specified?

But i am specfying password.
Please help.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

First of all, this has nothing at all to do with JSP. Even putting that code in JSP is a bad practice, it should go in a servlet or a helper class, but your question still isn't about servlets or helper classes, it's about JavaMail. So it belongs in the JavaMail forum.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You don't use SMTP to connect to GMail, you use SMTPS. Here's a link to the JavaMail FAQ, of which one FAQ is "How do I connect to GMail?"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need Help with JavaMail program
 
Similar Threads
creating website basic question
JavaMail Session cannot be resolved to a type
Email in jsp
Email with jsp
E mail using JSP Error