繁体   English   中英

仅显示JavaMailSender和客户端Outlook中的“名称”而非电子邮件地址

[英]Show only from “name” not email address in JavaMailSender and client Outlook

我使用的是Spring MimeMessageHelper和JavaMailSender。 发送电子邮件,电子邮件客户端(Outlook)时,是否可以仅显示邮件发件人姓名而不显示地址。

谢谢!

MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
// you can either do it this way with a regular string
message.setFrom("John Smith <john@example.com>");

// or this way with an InternetAddress
message.setFrom(new InternetAddress("john@example.com", "John Smith"));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM