javamail添加邮件附件时德文、中文乱码的问题

时间:2022-09-24 09:24:55

<span style="font-size:18px;">javamail附件名德文、中文为乱码的解决方法</span>
<span style="font-size:18px;"> MimeBodyPart attach2 = new MimeBodyPart(); attach1.setFileName(MimeUtility.encodeText("文件<span style="color: rgb(34, 34, 34); font-family: 'Microsoft Yahei', verdana; background-color: rgb(240, 248, 240);">Öntödei</span>.txt"),"UTF-8",null);</span>