summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorwilliam <william.fromtw@gmail.com>2015-09-30 22:50:38 +0800
committerwilliam <william.fromtw@gmail.com>2015-09-30 22:50:38 +0800
commit2dfdd53642e60289ee7f3b420844a8df53ec406b (patch)
treec73731626a0012f90447bd9e2a9fd6eb50889c22 /src/main
parentdbc524eb8eb26922df3a047457d21ac75d4d50d5 (diff)
downloadgitblit-2dfdd53642e60289ee7f3b420844a8df53ec406b.tar.gz
gitblit-2dfdd53642e60289ee7f3b420844a8df53ec406b.zip
send email subject utf-8 encoded
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/service/MailService.java4
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");