[BUG#2359][Alert] Mail Chinese name is too long garbled (#3199)

* 解决中文附件名过长时邮件附件中文乱码问题

* Solve the problem of messy Chinese name in excel attachment

* SonarCloud Code Analysis is not running . retry commit

* Update MailUtils.java

Co-authored-by: johnnygo920 <W@ngchen2020>
Co-authored-by: dailidong <dailidong66@gmail.com>
This commit is contained in:
johnnygo920 2020-07-14 23:22:42 +08:00 committed by GitHub
parent 438a009a3e
commit 1dfde72452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,10 @@ public class MailUtils {
public static final AlertTemplate alertTemplate = AlertTemplateFactory.getMessageTemplate();
//Solve the problem of messy Chinese name in excel attachment
static {
System.setProperty("mail.mime.splitlongparameters","false");
}
/**
* send mail to receivers
@ -341,4 +345,5 @@ public class MailUtils {
retMap.put(Constants.MESSAGE, "Send email to {" + String.join(",", receivers) + "} failed" + e.toString());
}
}