javamail 配置: 收件箱中显示我的中文名
程序员文章站
2022-03-02 09:32:30
...
上代码
这样就可以了
或者使用InternetAddress 的public static String toString(Address[] addresses)
详见 [url]http://doc.javanb.com/j2ee-docs-api-5-0-en/javax/mail/internet/InternetAddress.html#toString(javax.mail.Address[])[/url]
SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
try {
InternetAddress ia = new InternetAddress("[email protected]", "张学友", "UTF-8");
simpleMailMessage.setFrom(ia.toString());
} catch (UnsupportedEncodingException e) {
simpleMailMessage.setFrom("");
}
这样就可以了
或者使用InternetAddress 的public static String toString(Address[] addresses)
详见 [url]http://doc.javanb.com/j2ee-docs-api-5-0-en/javax/mail/internet/InternetAddress.html#toString(javax.mail.Address[])[/url]
上一篇: three.js笔记1
下一篇: 去掉IE6下的链接虚线框