This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes timed out exception while sending mail to my yahoo account Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "timed out exception while sending mail to my yahoo account" Watch "timed out exception while sending mail to my yahoo account" New topic

timed out exception while sending mail to my yahoo account

west timothy

Joined: May 16, 2005
Posts: 6

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
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
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 agree. Here's the link:
subject: timed out exception while sending mail to my yahoo account
Similar Threads
Can i send mail to other than Local Address with this code..i mean to Yahoo or Gmail
JSP using javamail
Email Host Configuration Problem
java mail urgent
Email with jsp