While migrating a simple SMTP mailer class from javax.mail to the current jakarta.mail, I ended up with the error
UnsupportedDataTypeException: no object DCH for MIME type ...
In various forums, some people suggested to write a custom DataHandler to support the missing MIME types in the newer Jakarta mail implementations.
Fortunately, the Java code does not need to be changed (despite the import changes).
After countless number of hours searching the Internet, I finally found the correct jar files to be used during runtime:
Hope this helps someone else.
The above is the detailed content of UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail. For more information, please follow other related articles on the PHP Chinese website!