私は以下のいくつかのコードを持っています:
Properties props = System.getProperties();
//set mail protocol
//props.setProperty("mail.store.protocol", "imaps");
props.setProperty("mail.store.protocol", "pop3s");
//create new store
Session session = Session.getDefaultInstance(props);
//store = session.getStore("imaps");
store = session.getStore("pop3s");
store.connect("pop.mail.yahoo.com", 995, "MyYahooUserName", "MyPassword");
//store.connect("imap.next.mail.yahoo.com", 993, "MyYahooUserName", "MyPassword");
isConnect = true;
IMAPプロトコルを試すとうまくいきますが、POP3では以下の例外が発生し、理由がわかりません
SEVERE: null
javax.mail.AuthenticationFailedException: EOF on socket
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:208)
at javax.mail.Service.connect(Service.java:295)
at gmailutilities.GmailUtilities.connect(GmailUtilities.java:88)
at gmailutilities.Main.main(Main.java:29)
javax.mail.MessagingException: Not connected
at com.sun.mail.pop3.POP3Store.checkConnected(POP3Store.java:408)
at com.sun.mail.pop3.POP3Store.getDefaultFolder(POP3Store.java:357)
at gmailutilities.GmailUtilities.openFolder(GmailUtilities.java:103)
at gmailutilities.Main.main(Main.java:30)
※理由わかる方いますか?助けてください。皆さんありがとう!*