I\'m using Java Mail API and I\'m trying to send an email through Gmail\'s SMTP. How my program works: java.util.Scanner class is used to get user input - I\'m asking user f
MimeMessage message = new MimeMessage(session);
message.setSubject(subject, "UTF-8");
message.setText(body, "UTF-8");
So one has to set the character encoding for both, body and subject.
Addendum because of comment of @bartac
For the corresponding MimeBodyPart
do a setHeader("Content-Type", "text/plain; charset=UTF-8")
.