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
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