当前位置: 代码迷 >> J2SE >> javax.mail.MethodNotSupportedException:   Expunge   not   supported
  详细解决方案

javax.mail.MethodNotSupportedException:   Expunge   not   supported

热度:508   发布时间:2016-04-24 16:42:47.0
使用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行啊。
  相关解决方案