简体   繁体   English

使用apache通用电子邮件使用“代表”发送电子邮件

[英]Send email using “on behalf of” using apache common Email

I want to send email from my application by adding "on behalf of" address. 我想通过添加“代表”地址从我的应用程序发送电子邮件。 Currently I am using apache common Email to send email and it seems I couldn't specify sender in there. 目前,我正在使用apache common Email发送电子邮件,似乎我无法在其中指定发件人。 As I can see email headers I need to set different values for sender and from to show email receive as "on behalf of" in the mail client. 如我所见,电子邮件标题需要为发件人和发件人设置不同的值,以显示电子邮件客户端中的接收邮件为“代表”。

Can anyone please help me to do this using java email client or can I achieve this using same apache common client? 谁能帮助我使用Java电子邮件客户端执行此操作,或者我可以使用同一apache通用客户端实现此操作? Solution needs to be work with most of common email clients like outlook, gmail etc.. 解决方案需要与大多数常见的电子邮件客户端(例如Outlook,Gmail等)一起使用。

As per link 根据链接

you can do 你可以做

 msg.addHeader("Sender", "My Friend <xxxxxx@xxxxx.com>");

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

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