Java发邮件中文标题乱码
//Base64编码的转换使得中文附件标题名在发送时不会变成乱码
import java.util.Base64.Encoder;
BodyPart messageBodyPart = new MimeBodyPart();
Encoder enc = Base64.getEncoder();
messageBodyPart.setFileName("=?GBK?B?" + enc.encodeToString(affixName.getBytes()) + "?=");