Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... Tired of Hibernate? Try JDBI in your code JDBI Quick sample ICategoryDAO.java : create a data access interface (implement is not required) package com.prhythm.erotic.task.data.... Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement...
Stats
no object DCH for MIME type multipart/mixed
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/related; 
 boundary="----=_Part_0_9042915.1299319807397"
 at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
 at javax.activation.DataHandler.writeTo(Unknown Source)
 at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
 at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1743)
 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:888)
 ... 4 more
There is something wrong with MailCap, javamail can not find a handler for such multipart/mixed part.
And the solution is add mime programmingly:
MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
mc.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html");
mc.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml");
mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
mc.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
mc.addMailcap("message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822");
CommandMap.setDefaultCommandMap(mc);