Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

timed out exception while sending mail to my yahoo account

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a java mailing program that uses SMTP protocol to send mails. The program successful sends mails to my local mail server. I tried out sending mails to my yahoo account by changing the host name to Yahoo. But my program is throwing timed out exception. Could anyone of you suggest me any workaround to fix this problem?


Below is the code snippet that I am using:
//sample code

String host="";//smtp server ip
String to=""
String from="";
String subject="updated";
String msgt="ldkisdgv";
Properties props=System.getProperties();
Session mailSession=Session.getDefaultInstance(props,null);
Message msg=new MimeMessage(mailSession);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address={new InternetAddress(to) };
msg.setSentDate(new java.util.Date());
when i changed hostName to
String hostName="";//http server
String to=""
String from="";

iam not getting output.will this change be sufficient or not
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked into this a while ago.

To send emails through the yahoo mail server (be it to send or to receive mail) you need to be on one of their paid subscription services. Then they will give you the information you need to access their servers.

If you are using the free yahoo mail, unfortunately you cannot access the mail server from any mail client that is not the yahoo web mail client.

I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic