DCH
is Data Content Handler. MimeType
handlers seem to be not configured correctly.
If you can download and use latest 1.5.*
version of java mail api, this error should be getting resolved.
Otherwise, within the code you can execute some statements to set the MimeType
handlers.
Add following code snippet to your mail module and is available for the mail Session
.
MailcapCommandMap mailcapCommandMap = new MailcapCommandMap();
mailcapCommandMap.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true");
CommandMap.setDefaultCommandMap(mailcapCommandMap);
You can extend this for additional MimeTypes
mailcapCommandMap.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
mailcapCommandMap.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html");
mailcapCommandMap.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml");
mailcapCommandMap.addMailcap("message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822");
Refer To:
- javax.activation.MailcapCommandMap.addMailcap(java.lang.String)
- Add entries to the registry. Programmatically added entries are searched before other entries.
Apart from this method, read entire documentation on this class.