• Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not connect to SMTP host  RSS feed

 
Ratan Kumar
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a sample program to send a mail.When I run I get this
error.

"javax.mail.SendFailedException: Sending failed;
nested exception is:

javax.mail.MessagingException: Could not connect to SMTP host:
mail.myserver.com, port: 25;
nested exception is:
java.net.ConnectException: Operation timed out: connect"

When i ping "mail.myserver.com" , I don't get a reply. Can this be the problem?

Thanks in advance.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're supposed to replace "mail.myserver.com" with the name of your SMTP server - it's just an example name.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!