mail-api
mail-api copied to clipboard
java.io.IOException: Unknown encoding:
Exception in thread "main" java.io.IOException: Unknown encoding: at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:92) at com.sun.mail.handlers.text_plain.getContent(text_plain.java:59) at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) at javax.activation.DataHandler.getContent(DataHandler.java:542) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:659) Caused by: javax.mail.MessagingException: Unknown encoding: at javax.mail.internet.MimeUtility.decode(MimeUtility.java:381) at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:85) ... 9 more
I find same problem from this https://github.com/javaee/javamail/pull/312 but ,it seems still not solve
I still need an example of a message to has this problem. Please post the raw MIME content of such a message.
Most likely the message was incorrectly encoded. You can try to guess what it meant by using the getRawInputStream method and read the raw data and try to decode it yourself.