diff options
author | James Moger <james.moger@gmail.com> | 2015-09-30 12:00:35 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2015-09-30 12:00:35 -0400 |
commit | 7be48d8d14c74dfb10ba3d71f12a78505daf29a6 (patch) | |
tree | c73731626a0012f90447bd9e2a9fd6eb50889c22 | |
parent | dbc524eb8eb26922df3a047457d21ac75d4d50d5 (diff) | |
parent | 2dfdd53642e60289ee7f3b420844a8df53ec406b (diff) | |
download | gitblit-7be48d8d14c74dfb10ba3d71f12a78505daf29a6.tar.gz gitblit-7be48d8d14c74dfb10ba3d71f12a78505daf29a6.zip |
Merge pull request #929 from willyann/develop
send email subject utf-8 encoded
-rw-r--r-- | src/main/java/com/gitblit/service/MailService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/service/MailService.java b/src/main/java/com/gitblit/service/MailService.java index ae9727fc..ec3a84ca 100644 --- a/src/main/java/com/gitblit/service/MailService.java +++ b/src/main/java/com/gitblit/service/MailService.java @@ -37,6 +37,7 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimeUtility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -196,7 +197,8 @@ public class MailService implements Runnable { }
message.setSentDate(new Date());
- message.setSubject(mailing.subject);
+ // UTF-8 encode
+ message.setSubject(MimeUtility.encodeText(mailing.subject, "utf-8", "B"));
MimeBodyPart messagePart = new MimeBodyPart();
messagePart.setText(mailing.content, "utf-8");
|