How do I send an HTML email?

The Solution to How do I send an HTML email? is


As per the Javadoc, the MimeMessage#setText() sets a default mime type of text/plain, while you need text/html. Rather use MimeMessage#setContent() instead.

message.setContent(someHtmlMessage, "text/html; charset=utf-8");

For additional details, see:

~ Answered on 2011-02-21 17:06:01


Most Viewed Questions: