Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to connect using JavaMail

S Mithal
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am writing a JAVAMail client to send an email to from . Both are legal mail addresses.

This is how I set the server name
props.put("", "");

My code compiles butI get an error while executing:

javax.mail.SendFailedException: Sending failed;
nested exception is: javax.mail.MessagingException: Could not connect to SMTP host:, port: 25;
nested exception is: Connection timed out: connect
at javax.mail.Transport.send0(
at javax.mail.Transport.send(
at Mail.postMail(
at Mail.main(

I have enabled the port 25 explicitly.

S Mithal
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic