My SMTP server supports 8-bit MIME. How can I tell JavaMail to use it?

John Zukowski

Set the mail.smtp.allow8bitmime property to true:

props.put("mail.smtp.allow8bitmime", "true");

This works with Sun's SMTP provider. Other providers may differ. According to the docs:

If set to true, and the server supports the 8BITMIME extension, text parts of messages that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC2045 rules for 8bit text.