What causes an "javax.activation.UnsupportedDataTypeException: no object DCH for MIME type xxx/xxxx javax.mail.MessagingException: IOException while sending message;" to be sent and how do I fix this? [This happens for known MIME types like text/html.]

Mauro Gagni

The Java Activation Framework used by JavaMail is not configured correctly.

It doesn't know how to handle the text/html content type.

An html handler is provided in JavaMail 1.1.3 but the mailcap file is not configured to use it.

Add to your mailcap file the line:

text/html;; x-java-content-handler=com.sun.mail.handlers.text_html

and create a multipart message when sending html messages, otherwise it will not be recognised as an HTML page from the client.

HTML messages does not cause this problem with the 1.2 release of the JavaMail API.

Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact