Sending multiple copies
At times, you may need to send an email to several addresses at once, so that each addressee could see other recipients in To: or CC: fields. Or, alternatively, you may want to send someone a “blind copy”, or BCC. Here, we’ll show you how this can be accomplished.
Sending copies via Web API
Sending copies differs from regular sending in that the email parameter indicates the primary recipient, while the "To:" and "CC:" headers contain other addresses. For this, we need to specify the necessary headers "To:" and "CC:" in the headers parameter. UniOne sends these headers "as is", without changing anything about them (only MIME encoding them if necessary).
Let's consider a simple example when you need to send a letter to John at [email protected] along with a copy to Mary at [email protected]. this case, the recipients and headers parameters of the email/send method should be as follows:
"recipients": [
{"email":"[email protected]"},
{"email":"сс@example.org"}
],
"headers": {
"To": "John <[email protected]>",
"CC": "Mary <[email protected]>"
}
Here's a more complex example. We send a letter to Miguel and José, with copies to Helen and Habib, plus a blind copy to [email protected]:
"recipients": [
{"email":"[email protected]"},
{"email":"[email protected]"},
{"email":"[email protected]"},
{"email":"[email protected]"},
{"email":"[email protected]"}
],
"headers": {
"To": "Miguel <[email protected]>, José <[email protected]>",
"CC": "Helen <[email protected]>, Habib <[email protected]>"
}
Please note the following:
- The names for "To" and "CC" addresses in the headers can be sent “as is”, without MIME encoding of any international characters.
- It is important to keep in mind that substitutions in a letter can be different for each recipient. If you want all addressees to receive the same text, either use the same substitutions for each one, or use the global_substitutions parameter instead of personal substitutions.
- Links for tracking email opens and clicks, as well as the unsubscribe link, will always be unique for each recipient.
- Your account will be charged for each email specified in the recipients array.
There are several restrictions when sending copies with UniOne:
- You cannot specify a "CC" header without a "To" header – this will result in a sending error. The “To” header without “CC” is allowed.
- The number of addresses in the "To" header is limited to ten; the same restriction applies to the "CC" header. There can also be a maximum of ten blind copies.
- If the address from the email parameter is not listed as either “To” or “CC” (i.e., it is used to create a blind copy), then this address can only be on your own domain already verified in UniOne. You cannot send blind copies to domains other than those you own. Unfortunately, we have to enforce this rule to prevent email phishing.
Sending copies via SMTP API
By default, when sending via SMTP, UniOne does not strictly adhere to the RFC specifications. Instead, it sends each recipient from the “To” and “CC” headers their own copy of the letter with a single email address in the final “To” header, which matches the real address of the recipient.
If you need strict compliance with the SMTP standard, i.e. emails being sent without changing the To: and CC: MIME headers (for example, to send regular and blind copies with CC and BCC), you must enable strict mode by setting the strict parameter to true in the X-UNIONE header like this: X-UNIONE: {"strict":true}, or contact technical support to enable {"strict":true} for all your emails without having to pass an additional parameter in the header.
Unlike the email/send Web API call, when sending via SMTP, you are responsible for the correct MIME encoding of the headers. By default, you’ll be charged for each address in the To or CC header; in strict mode – for each recipient in the RCPT TO.
Strict mode limitations are similar to those listed for the Web API above:
- You cannot specify a "CC" header without a "To" header – this will result in a sending error. The “To” header without “CC” is allowed.
- The number of addresses in the "To" header is limited to ten; the same restriction applies to the "CC" header. There can also be a maximum of ten blind copies.
- If the address from the email parameter is not listed as either “To” or “CC” (i.e., it is used to create a blind copy), then this address can only be on your own domain already verified in UniOne. You cannot send blind copies to domains other than those you own. Unfortunately, we have to enforce this rule to prevent email phishing.