diff --git a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java index a2469ec279..c19d1e817f 100644 --- a/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java +++ b/services/src/main/java/org/keycloak/email/DefaultEmailSenderProvider.java @@ -24,7 +24,6 @@ import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel; import org.keycloak.services.ServicesLogger; -import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.Session; @@ -108,10 +107,10 @@ public class DefaultEmailSenderProvider implements EmailSenderProvider { multipart.addBodyPart(htmlPart); } - Message msg = new MimeMessage(session); + MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(from)); msg.setHeader("To", address); - msg.setSubject(subject); + msg.setSubject(subject, "utf-8"); msg.setContent(multipart); msg.saveChanges(); msg.setSentDate(new Date());