通过sendmail发送时如何显示收件人地址

How to display the recipient address when sending via sendmail

我正在尝试发送

sendmail -it email@example.com < email.eml

和 "To" 中的收件人看到空的或未公开的收件人。

如何删除"undisclosed recipients"并显示收件人的电子邮件?

sendmail 希望您在标准输入中提供 headers。

-t 选项告诉它从 headers 获取收件人,因此您不需要将其作为参数包含在内。

{ echo "To: email@example.com"; echo; cat email.eml; } | sendmail -it

空的echo是在headers和body之间空一行。