Adds UTF-8 charset to emails
This commit is contained in:
parent
9a2cc3a9cc
commit
8660ed91eb
1 changed files with 4 additions and 4 deletions
|
@ -172,15 +172,15 @@ public class FreemarkerEmailMessage {
|
|||
if (htmlContent.isEmpty()) {
|
||||
log.error("Message has neither text body nor HTML body");
|
||||
} else {
|
||||
msg.setContent(htmlContent, "text/html");
|
||||
msg.setContent(htmlContent, "text/html; charset=UTF-8");
|
||||
}
|
||||
} else {
|
||||
if (htmlContent.isEmpty()) {
|
||||
msg.setContent(textContent, "text/plain");
|
||||
msg.setContent(textContent, "text/plain; charset=UTF-8");
|
||||
} else {
|
||||
MimeMultipart content = new MimeMultipart("alternative");
|
||||
addBodyPart(content, textContent, "text/plain");
|
||||
addBodyPart(content, htmlContent, "text/html");
|
||||
addBodyPart(content, textContent, "text/plain; charset=UTF-8");
|
||||
addBodyPart(content, htmlContent, "text/html; charset=UTF-8");
|
||||
msg.setContent(content);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue