|
-
March 5th, 2000, 01:32 AM
#1
JavaMail with Pop3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|