commander
March 5th, 2000, 12:32 AM
I used JavaMail and Pop3 libraries from SUN to finish a simple project.
But I met a problem.
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
Store store = null;
Folder rf = null;
store = session.getStore("pop3");
host = "pop.mail.yahoo.com";
user = "xxxx";
password = "xxxx";
store.connect(host, user, password);
rf = store.getDefaultFolder();
if (rf instanceof com.sun.mail.pop3.POP3Folder) {
System.out.println("right");
}
System.out.println("\nOK. Folder got");
Message[] msgs = rf.getMessages();
System.out.println(msgs.length);
The msgs.length == 0! , WHY? I used mail.yahoo.com to access, there are 7 mails in the INBOX folder.
BTW , the "right" and "OK. Folder got" are printed.
Could anyone help me out?
Thanks
But I met a problem.
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
Store store = null;
Folder rf = null;
store = session.getStore("pop3");
host = "pop.mail.yahoo.com";
user = "xxxx";
password = "xxxx";
store.connect(host, user, password);
rf = store.getDefaultFolder();
if (rf instanceof com.sun.mail.pop3.POP3Folder) {
System.out.println("right");
}
System.out.println("\nOK. Folder got");
Message[] msgs = rf.getMessages();
System.out.println(msgs.length);
The msgs.length == 0! , WHY? I used mail.yahoo.com to access, there are 7 mails in the INBOX folder.
BTW , the "right" and "OK. Folder got" are printed.
Could anyone help me out?
Thanks