Forums Register Login

javax.mail.MessagingException is thrown when sending mail

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Is the server up, reachable from your machine, and listening on port 25?
+Pie Number of slices to send: Send
Yes, the server is up. While running my application locally, it connects to the server. It only gives problem when I check it online.
+Pie Number of slices to send: Send
 

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?
+Pie Number of slices to send: Send
"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?
+Pie Number of slices to send: Send
That leaves the question of whether the mail server and its port 25 are reachable from the server you're running the code from.
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1879 times.
Similar Threads
java mail error
Sending a mail
Retrying sending an email with messaging exception
Unknown host exception
Port of SMTP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:32:55.