non-ASCII in Java Mail body
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Syed_Niaz
Posted On:   Wednesday, November 6, 2002 12:11 AM

Hello,

How can I send non-ASCII characters in a mail body with the Java Mail API.

String DefaultCharSet= MimeUtility.getDefaultJavaCharset();
System.out.println("DefaultCharSet "+DefaultCharSet ) ;
msg.setText(MimeUtility.encodeText("’later",DefaultCharSet,"base64"));

the above code send the mail as =?Cp1252?Q?=92later?=

Any suggestions?

Thanks

Regards,
Syed Niaz

Re: non-ASCII in Java Mail body

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, November 6, 2002 07:25 AM

The sample you give ("=?Cp1252?Q?=92later?= ") is encoded as "quoted-printable", so you have to set the Content-Transfer-Encoding header, to indicate that the body is encoded as quoted printable. The receiver's mail client will then decode it correctly.

About | Sitemap | Contact