aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Unable to connect using JavaMail 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 "Unable to connect using JavaMail" Watch "Unable to connect using JavaMail" New topic
Author

Unable to connect using JavaMail

S Mithal
Greenhorn

Joined: Mar 17, 2005
Posts: 19
Hi,

I am writing a JAVAMail client to send an email to xyz@yahoo.com from abc@yahoo.com . Both are legal mail addresses.

This is how I set the server name
props.put("mail.smtp.host", "smarthost.yahoo.com");

My code compiles butI get an error while executing:

javax.mail.SendFailedException: Sending failed;
nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: smarthost.yahoo.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at Mail.postMail(Mail.java:41)
at Mail.main(Mail.java:49)

I have enabled the port 25 explicitly.

TIA
S Mithal
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to connect using JavaMail