• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Unable to connect using JavaMail

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am writing a JAVAMail client to send an email to [email protected] from [email protected] . 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic