I am trying to send an email from my servlet. There is no exception but i am not getting email in my account. I am using the following code:
public class Se
Are you running an e-mail server on your localhost? If so, does it have authentication disabled?
Maybe you can see the error messages in its logs.
Generally you can use JavaMail to send mail using servlets. You stated that you are using AppEngine ( Why can't i send email from my servlet and getting java.security.AccessControlException? ). Google App Engine allows you to send email using JavaMail, But you cannot use JavaMail provided by appengine to connect to any mail server.SMTP configuration added to the Transport or Session is ignored. https://developers.google.com/appengine/docs/java/mail/usingjavamail#JavaMail_Features_Not_Supported
it seems like mistake is :
props.put("mail.smtp.host","localhost");
it should not be localhost until you are running mail server on your system..
look at this question : Using Javamail to connect to Gmail smtp server ignores specified port and tries to use 25
and yes as commented by Axel try with commandline first
The reason is , you are using localhost as the smtp host , you should use deploy mail server on your computer before using localhost as a sender. Even after that you may require to register your server.
you can also do that using gmail or yahoo mail. Use the smtp host of google mail. Authenticate using your creds and then go ahead.
try this link :
http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/
Read https://developers.google.com/appengine/docs/java/mail/overview Basically stop including any JavaMail libraries in your app and don't try to connect to a host. Build the message and jump straight to Transport.send(msg);