File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes javax.mail.MessagingException is thrown when sending mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "javax.mail.MessagingException is thrown when sending mail" Watch "javax.mail.MessagingException is thrown when sending mail" New topic
Author

javax.mail.MessagingException is thrown when sending mail

Joseph Bashir
Ranch Hand

Joined: Jun 16, 2004
Posts: 41
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
Marshal

Joined: Mar 22, 2005
Posts: 41859
    
  63
Is the server up, reachable from your machine, and listening on port 25?


Ping & DNS - my free Android networking tools app
Joseph Bashir
Ranch Hand

Joined: Jun 16, 2004
Posts: 41
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
Marshal

Joined: Mar 22, 2005
Posts: 41859
    
  63
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

Joined: Jun 16, 2004
Posts: 41
"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
Marshal

Joined: Mar 22, 2005
Posts: 41859
    
  63
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

Joined: Jun 16, 2004
Posts: 41
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

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.mail.MessagingException is thrown when sending mail