当我从 POP3 收到电子邮件时,出现以下错误
Fatal exception java.io.IOException: Unknown encoding: 8bitPrecedence
at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:109)
at com.sun.mail.handlers.text_plain.getContent(text_plain.java:107)
at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:790)
at javax.activation.DataHandler.getContent(DataHandler.java:537)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1419)
源代码
Session session = property.getSession();
HashMap<String, String> isNotified = Util.getIsNotified(connection, userId);
store = session.getStore("pop3");
store.connect();
inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
int count = inbox.getMessageCount();
for(int i = 0; i < count; i++)
{
Message message = inbox.getMessage(i);
Object content = message.getContent();
}
收到的其他消息没有任何错误