无需抄送即可向多个用户发送邮件

无需抄送即可向多个用户发送邮件

大家好,我想知道是否可以使用 sendmail 来在 To: 中字符串化多个电子邮件地址

From: sendmail
To: [email protected];[email protected]
Subject: Did You Both Receive It?

I hope you did

而不是使用

From: sendmail
To: [email protected]
Cc: [email protected]
Subject: Did You Both Receive It?

I hope you did

答案1

要将多个地址放在To:orCc:Bcc:行上,请用逗号(加上可选空格)分隔它们。有些邮件阅读器允许键入分号来分隔地址并显示用分号分隔的地址,但这不是标准语法。

From: sendmail
To: [email protected], [email protected]
Subject: Did You Both Receive It?

您可以在逗号之后将标头拆分为多行(以及地址中的其他一些位置,但这比较棘手)。续行必须至少以一个空格或制表符开头。

From: sendmail
To: [email protected],
    [email protected]
Subject: Did You Both Receive It?

答案2

您可以To:多次使用该标头。我对此有点怀疑,但我只是在 SMTP 服务器上尝试了一下,它接受了它。

所以,与其发送...

From: sendmail
To: [email protected]
Cc: [email protected]
Subject: Did You Both Receive It?

I hope you did

...您可以发送:

From: sendmail
To: [email protected]
To: [email protected]
Subject: Did You Both Receive It?

I hope you did

在我的客户端(Thunderbird)中,收件人一起出现,如下所示:

To person01 <[email protected]>, person02 <[email protected]>

并且源保持不变(sTo:没有在途中被转换):

To: [email protected]
To: [email protected]

现在,由于 SMTP 服务器允许我发送两条RCPT TO:消息,我假设sendmail也能够做到这一点。大概是这样的...

$ sendmail "[email protected],[email protected]" <<EOF
To: [email protected]
To: [email protected]
...

Your message.
EOF

相关内容