In sparkpost, if I was to send emails to "[email protected]", "[email protected]" & "[email protected]" & along with that have cc'ed email "[email protected]".
{
"recipients": [
{
"address": {
"email": "[email protected]"
}
},
{
"address": {
"email": "[email protected]"
}
},
{
"address": {
"email": "[email protected]"
}
},
{
"address": {
"email": "[email protected]",
"header_to": "[email protected];[email protected];[email protected]"
}
}
],
"content": {
"from": "[email protected]",
"headers": {
"CC": "[email protected]"
},
"subject": "To and CC",
"text": "This mail was sent to many while CCing [email protected]."
}
}
Here cc would only get 1 email, with all "to" addresses in email's to header.
All other "to" emails would also get 1 email, where each recepient is only able to see 2 emails : his own & the cc email.
My question is how do they do this? I have to replicate this to Amazon Ses raw email. I tried sending emails indiviually, but cc is getting n + 1
emails as there are n
"to" & 1 of his own.
I tried to send email individually in Amazon ses raw email but cc gets n + 1
emails as he has been cc'ed in those n
"to" emails.
The headers only matter for display purposes; what is actually being sent is determined by the SMTP envelope. There is no way to have individualized headers in each message other than by sending individualized messages. Probably behind the scenes, they split up the message into multiples after generating the Cc: copy.
In some more detail,
To:
recipients in the headers, but only send it to theCc:
recipientTo:
recipient, generate and send a new message only to themThere are many questions about the difference between headers and envelope information. In very brief, SMTP lets you specify the sender with
MAIL FROM:<[email protected]>
and each recipient withRCPT TO:<[email protected]>
; and then, you supply the message in theDATA
transaction, including all the headers. (The headers will be updated by reach handling MTA; on delivery, the final MTA will usually put the envelope sender inReturn-Path:
, and optionally the final local recipient inDelivered-To:
.)