How can I set the transfer encoding type??? I wish to send an HTML mail using MimeMessage class and encode it to "base64". but I couldn't set the Content-Transfer-Encoding value of mail header.
Created May 4, 2012
marx0207 wang Encode the Html in "Base64",
for example:
B short for Base64
String Html="<html><body>"+ "this is a test"+ </body></html>"; MimeMessage msg =new MimeMessage(); String DefaultCharSet= MimeUtility.getDefaultJavaCharset(); msg.setText(MimeUility.encodeText(Html,DefaultCharSet,"B")); msg.send();Q short for Quoted Printable
B short for Base64
<explain>
I use MimeUtility.encodeText(,,) for encode process, you could use that method encode your HTML string in "B"--Base64 and be set on the message part.
for details check in JavaMail Api javax.mail.internet.Mimeutility section.