我正在为 java 使用 Sparkpost 客户端库。
当我设置 afromEmail
和username
to时,contentAttributes
我希望在收到的电子邮件中看到 Name Name 而不是 name@mydomain.com。但它不起作用。有没有办法在消息中显示名称而不是电子邮件?
TemplateContentAttributes contentAttributes = new TemplateContentAttributes();
AddressAttributes addressAttributes = new AddressAttributes();
addressAttributes.setName(username);
addressAttributes.setEmail(fromEmail);
contentAttributes.setFrom(addressAttributes);
contentAttributes.setSubject(subject);
contentAttributes.setHtml(html);
contentAttributes.setText(text);