Monday, April 23, 2012

Javamail changing charset of subject line

I am using Javamail (javax.mail) to send mails. I successfully adjusted contents of my mail as utf-8. However I could not set subject line as a utf-8 encoded string.



I tried even



mail.setSubject(new String(subject.getBytes("utf-8"), "utf-8"));


on subject however it still sends as Cp1252. Example headers from mail are given below:



Any ideas?



example from mail headers





No comments:

Post a Comment