• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic