• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I read a mail from Hotmail or yahoo  RSS feed

 
Parthiban Sivaji
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Is there anyone to help me with this code.I took this code from one book.
import javax.mail.*;
import javax.mail.internet.*;
public class GetListExample {
public static void main (String args[]) throws Exception {
String host = args[0];
String username = args[1];
String password = args[2];
// Get session
Session session = Session.getInstance(
System.getProperties(), null);
// Get the store
Store store = session.getStore("pop3");
store.connect(host, username, password);
// Get folder
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
// Get directory
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i<n; i++) {>
System.out.println(i + ": " + message[i].getFrom()[0]
+ "\t" + message[i].getSubject());
}
// Close connection
folder.close(false);
store.close();
}
}
The below code is compiling perfectly. It takes three i/p parameters like hostname, user and password. Here which hostname to give . I tried giving www.hotmail.com , one username and password . I am getting an error saying that Connect failed and NoRouteToHostException.
Is there anything else I should do to read a mail in hotmail through my program. I am inside a proxy server . Could u also tell me how I should give the hostname. I would be thankful if anyone could give me the response at the earliest. My company uses MSExchange Server 5.5. I was not able to connect to it . To which I found out that a patch should be installed in the server.

Thanks in Advance,
Parthiban.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!