Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SMTP Send Email : Java Mail : No Route to Host Exception  RSS feed

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

When i am trying to send mail using java mail api, i am getting following exception... below is the complete stack trace...



Can anybody help me out with this issue.

What does "No route to host: connect" means ???

The same code is deployed somewhere else and its working fine....

Thanks
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means what it says, pretty much. There is no network path from your computer to the SMTP server. Perhaps there is a firewall or a router blocking the path, or perhaps your computer is not connected to the network at all. Talk to somebody who understands the network to find out exactly what the problem is.

And now you should be able to see that the fact that it can connect to the SMTP server from some other computer has nothing much to do with this problem.

Edit: looking at the stack trace, your code is actually trying to send an HTTP request. So it isn't trying to connect to an SMTP server, it's trying to connect to an HTTP server. Same network problem, though. And I don't see any JavaMail classes in the stack trace either. That doesn't change anything about my answer either, it's just harder to identify the problem when you post misleading information.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1: open a DOS prompt and execute the following command:
(replace <HOST> with the actual host you are trying to connect to)
If that also says that no route to the host is available, then it definitely is a network issue and you need to contact your system administrator.

Step 2: if the network is not a problem, post the code that is sending the emails. Tell the details.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!