• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

timed out exception while sending mail to my yahoo account

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

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?

Thx,
Anil

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

String host="2.2.2.2";//smtp server ip
String to="abc@abc.com"
String from="xyz@xyz.com";
String subject="updated";
String msgt="ldkisdgv";
Properties props=System.getProperties();
props.put("mail.host",host);
props.put("mail.tranport.protocol","smtp");
Session mailSession=Session.getDefaultInstance(props,null);
mailSession.setDebug(sessionDebug);
Message msg=new MimeMessage(mailSession);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address={new InternetAddress(to) };
msg.setRecipients(Message.RecipientType.TO,address);
msg.setSubject(subject);
msg.setSentDate(new java.util.Date());
msg.setText(msgt);
Transport.send(msg);
<hr>
</code>
when i changed hostName to
String hostName="mail.yahoo.com";//http server
String to="abc@yahoo.com"
String from="xyz@yahoo.com";


iam not getting output.will this change be sufficient or not
 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Cheers,
Rachel
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic