使用expunge()删除邮件时出错
原码是:
Folder inbox = new Folder();
inbox = store.getDefaultFolder().getFolder( "INBOX ");
inbox.open(Folder.READ_WRITE);
messages = inbox.expunge();
出错信息
javax.mail.MethodNotSupportedException: Expunge not supported
at com.sun.mail.pop3.POP3Folder.expunge(POP3Folder.java:313)
at testChinese.MailGet.getMessages(MailGet.java:53)
at testChinese.MailGet.printMailList(MailGet.java:66)
at testChinese.MailTest.main(MailTest.java:28)
------解决方案--------------------javax.mail.MethodNotSupportedException: Expunge not supported
at com.sun.mail.pop3.POP3Folder.expunge(POP3Folder.java:313)
你看你POP3Folder.java的第313行啊。