Hi All,
I am trying out a small application using Javamail. I have setup property "mail.smtp.host" to the smtp server using which i am able to send emails. So the server address is valid and the server is running. But still i am getting this exception as : -
==========================================================
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: < nested exception is:
java.net.SocketException: Operation timed out: connect:could be due to invalid address
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at test.OTPEmail.postMail(OTPEmail.java:85)
at test.OTPEmail.main(OTPEmail.java:44)
===========================================================
I am behind a firewall. Will it matter anyway?
Regards,
Rahul.
-
JavaMail problem (3 messages)
- Posted by: Rahul Toraskar
- Posted on: November 01 2004 00:03 EST
Threaded Messages (3)
- JavaMail problem by Ian Purton on November 01 2004 07:49 EST
- Is the mail server on the other side of the FW? by Anthony Randazzo on November 04 2004 20:49 EST
- Debugging JavaMail by Avenger Inc on November 05 2004 02:38 EST
-
JavaMail problem[ Go to top ]
- Posted by: Ian Purton
- Posted on: November 01 2004 07:49 EST
- in response to Rahul Toraskar
Have you tried a telnet to your server
i.e. telnet [smtphost] 25
if it connects type HELO and you should get a response.
if you cannot connect then the problem is not with your software.
Ian Purton
Website Uptime and Availability | Permission Email List Management | Smartphone GPS | All Time Top 100 Rock Charts -
Is the mail server on the other side of the FW?[ Go to top ]
- Posted by: Anthony Randazzo
- Posted on: November 04 2004 20:49 EST
- in response to Rahul Toraskar
If the mailserver is on the otherside of the FW you may not be able telnet to 25. A FW may restrict telnet. If not, try using the IP address of the mailserver. It may be a DNS or local network configuration issue.
Can you ping by name & IP? -
Debugging JavaMail[ Go to top ]
- Posted by: Avenger Inc
- Posted on: November 05 2004 02:38 EST
- in response to Rahul Toraskar
The above two suggestions will be useful if you were to set the debugging on in your code, and then follow through to the point where the exception is raised. In verbose mode, the javamail program that you write will print out each request and response provided. This is the best way to figure out where it goofs up :-).