我想从 R 向多个收件人发送一封邮件。我可以使用sendmail
功能,但当收件人收到电子邮件时,他们只能看到自己的电子邮件地址to
场地。看起来 sendmail 内部循环并向每个收件人发送单独的电子邮件,这不是真的carbon copy
。重要的是,每个收件人都可以看到其特定电子邮件的所有收件人(业务要求,因为他们需要回复此电子邮件的所有收件人)。我如何使用 R 来实现这一目标?
my code
require(sendmailR)
to <- c("[email protected] /cdn-cgi/l/email-protection")
header <- list(cc=c("[email protected] /cdn-cgi/l/email-protection"))
x <- sendmail("[email protected] /cdn-cgi/l/email-protection", to, "test", "testing", header=header,control=list(smtpServer=server,verbose=TRUE))
<< 220 equity.xyz.com ESMTP Sendmail 8.11.7p1+Sun/8.11.7; Thu, 11 Jul 2013 21:31:43 -0400 (EDT)
>> HELO HKD03836654
<< 250 equity.xyz.com Hello HKD03836654.gbl.ad.net [169.34.175.142], pleased to meet you
>> MAIL FROM: [email protected] /cdn-cgi/l/email-protection
<< 250 2.1.0 [email protected] /cdn-cgi/l/email-protection... Sender ok
>> RCPT TO: [email protected] /cdn-cgi/l/email-protection
<< 250 2.1.5 [email protected] /cdn-cgi/l/email-protection... Recipient ok
>> DATA
<< 354 Enter mail, end with "." on a line by itself
>> <message data>
<< 250 2.0.0 r6C1Vh101169 Message accepted for delivery
>> QUIT
<< 221 2.0.0 equity.csfb.com closing connection
调试选项的输出。调试输出中不存在标头信息。
> sendmail("[email protected] /cdn-cgi/l/email-protection", to, "test", "testing", header=header,control=list(smtpServer=server,transport="debug"))
From: [email protected] /cdn-cgi/l/email-protection
To: [email protected] /cdn-cgi/l/email-protection
Subject: test
Date: Mon, 15 Jul 2013 02:15:29 -0000
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1a556aa6576e231876dabb67e5a4f58730d3a228654e14705503b6985a6a6707"
This is a message with multiple parts in MIME format.
--1a556aa6576e231876dabb67e5a4f58730d3a228654e14705503b6985a6a6707
Content-Type: text/plain; format=flowed
testing
--1a556aa6576e231876dabb67e5a4f58730d3a228654e14705503b6985a6a6707--
谢谢。