I have written servlet class and send mail class to send Javamail. The English message works fine, but now I want to send Chinese as well. I suppose you add UTF-8 in MimeMessage's setSubject and setText methods. Email subject and message comes from user input in submit form. I both want subject and message itself accepts Chinese.
Here is my code:
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session);
// Set From: header field of the header.
// Set To: header field of the header.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
// Set Subject: header field
// Send the actual HTML message, as big as you like