How to connect to an SMTP server [ BEHIND THE PROXY ] to send emails from java application.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Yasir_Khan
Posted On:   Tuesday, July 23, 2002 03:19 AM

Hi, I have written a simple java application that can send emails to specified TO address using specified SMTP server, it works fine if there is no Proxy Server involed in communication, but the same application fails to connect to SMTP server when the application run behind some Proxy Server, I want to solve this problem, so that I can connect to SMTP server from behind the Proxy Server. I m getting following exception in case of using proxy server: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: yasirkhan.com, port: 25 Can anybody solve this problem ??? Thanx in advance    More>>

Hi,

I have written a simple java application that can send emails to specified TO address using specified SMTP server, it works fine if there is no Proxy Server involed in communication, but the same application fails to connect to SMTP server when the application run behind some Proxy Server, I want to solve this problem, so that I can connect to SMTP server from behind the Proxy Server.
I m getting following exception in case of using proxy server:


			
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: yasirkhan.com, port: 25



Can anybody solve this problem ???


Thanx in advance


Regards,


YK    <<Less

Re: How to connect to an SMTP server [ BEHIND THE PROXY ] to send emails from java application.

Posted By:   Bogdan_Sheptunov  
Posted On:   Tuesday, July 23, 2002 10:39 AM

Yasir,


the first thing you do in this case is to check if your server is physically able to connect to the specified server through the specified port.


Execute the following command on the machine from which are you running your Java code:


telnet yasirkhan.com 25

If this gives you "connection failed" error message, it would mean that you are physically not able to get there (for various reasons; most likely one is that port 25 is blocked at your firewall).


If you get any other answer (like the screen goes blank or you see some output), it would mean that you are able to get to the server. In this case, start playing with your code (I am not an expert in JavaMail, so I can't help you much here).

Re: How to connect to an SMTP server [ BEHIND THE PROXY ] to send emails from java application.

Posted By:   Dan_Sadowski  
Posted On:   Tuesday, July 23, 2002 08:39 AM

Your proxy may be blocking port 25.



-Dan
About | Sitemap | Contact