I am using java to send emails. The message sent can be in different languages, but when I send it in Japanese, the received mail just have "???????" characters.
The code is something like this:
String content = "\u30d5\u30a1\u30a4\u30eb\u540d:";
SMTPMessage message = new SMTPMessage(sess);
message.setFrom(new InternetAddress(from));
InternetAddress dests[] = new InternetAddress[]{ new InternetAddress(to) };
message.setRecipients(Message.RecipientType.TO, dests);
message.setSubject(subject);
message.setContent(content, "text/html");
Transport.send(message);
The content sent are unicode characters. How should I encode correctly the message?