• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.mail.MessagingException is thrown when sending mail

 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

When running my application locally, I have no problem in sending mail through my application. But when I upload the same application on server and run from there, I get the following exception:



Can someone tell me why I am getting this exception?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the server up, reachable from your machine, and listening on port 25?
 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the server is up. While running my application locally, it connects to the server. It only gives problem when I check it online.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While running my application locally, it connects to the server. It only gives problem when I check it online.

What is the difference between "running the app locally" and "check it online"? The server is always remote, isn't it?
 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Running the app locally" means running the application on local IP and "check it online" means after uploading it on the server. In the first case, my application connects to my mail server successfully, but in the second case, it does not connect to my mail server and javax.mail.MessagingException is thrown. Any idea please?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That leaves the question of whether the mail server and its port 25 are reachable from the server you're running the code from.
 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to know whether the mail server and its port 25 are reachable from the server I am running the code from? If yes, then how and how can I solve this problem?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try telneting to it. Its not a fool proof way to do it but usually if you can telnet to your SMTP server you can connect to it via Java Mail.

However, the best way to avoid these configuration headaches is to speak to your network administrator.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic