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 t
Solved.
import static java.nio.charset.StandardCharsets.*; byte[] bytes = subject.getBytes(ISO_8859_1); subject = new String(bytes, UTF_8); mail.setSubject(subject);