You need to combine all the real recipients and send an email for each of them separately. CC is merely informational as such; leave this and you get BCC So, for example:
to <- c(" vasudeva.naik@abc.com ")
If you need all the addresses in the To header, you can use header <- list(to=to) instead.
Please note that the above is not verified. It should work theoretically, but sendmailR may have other plans for handling some arguments.
Expand previous comment. There are two parts to sending email, SMTP is the protocol for delivering the message to the recipients and the content of the message itself.
SMTP, which handles delivery, looks something like this:
MAIL FROM: toto@abc.com RCPT TO: vasudeva.naik@abc.com DATA <message content here, see below> .
Note that FROM and To here correspond to the arguments to the sendmail() function. This determines who receives the mail.
Now the message content (well, only the headers) looks something like this:
From: no-reply@example.com To: everyone@example.com CC: everyone-else@example.com
And yes, FROM and To completely different from the previous ones. This is what the recipients receive and see, but it has nothing to do with whoever actually receives the email. Therefore, spam in your inbox appears as something you sent to someone else, even if you are the actual recipient.
source share