I want to send a single mail to multiple recipients from R. I am able to achieve this using sendmail
function but when recipients recieve the email, they see only their email address in to
field. Looks like sendmail internally loops and sends individual emails to each recipient which is not a true carbon copy
. It is important that each recipient sees all the recipients intended for their specific email (business requirement, because they need to reply to all recipients of this email). how can I achieve this using R?
my code
require(sendmailR)
to <- c("vasudeva.naik@abc.com")
header <- list(cc=c("alok.jadhav@abc.com"))
x <- sendmail("toto@abc.com", 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: toto@abc.com
<< 250 2.1.0 toto@abc.com... Sender ok
>> RCPT TO: vasudeva.naik@abc.com
<< 250 2.1.5 vasudeva.naik@abc.com... 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
Output from debug option. header information is not present in the debug output.
> sendmail("toto@abc.com", to, "test", "testing", header=header,control=list(smtpServer=server,transport="debug"))
From: toto@abc.com
To: vasudeva.naik@abc.com
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--
Thanks.