Description
BatchSendMail is used for sending batch emails.
Request parameters
Name | Type | Required? | Description |
---|---|---|---|
Action | String | Required | Operation interface name, a system required parameter. Value: BatchSendMail. |
AccountName | String | Required | The sender address configured in the console. |
AddressType | Number | Required | Value range: 0-1. 0 indicates a random address, and 1 indicates the sender address. |
TemplateName | String | Required | The name of the template that is created and verified in advance . |
ReceiversName | String | Required | The name of the recipient list that is created in advance and uploaded with recipients. |
TagName | String | Optional | The mail tag name. |
ClickTrace | String | Optional | Value range: 0-1. 1 indicates enabling recipient tracking. 0 indicates that not enabling recipient tracking. The default value of this parameter is 0. |
For other request parameters, see Public parameters.
Return parameters
For more information about public return parameters, see Public parameters.
Error codes
Error code | Description | HTTP status code | Meaning |
---|---|---|---|
InvalidMailAddress.NotFound | The specified mailAddress does not exist. | 400 | The sender address does not exist. |
InvalidMailAddressStatus.Malformed | The specified mailAddress status is wrongly formed. | 400 | The sender address status is incorrect. |
InvalidMailAddressSendType.Malformed | The specified mailAddress sendType is wrongly formed. | 400 | The sender address type is incorrect. Only the batch-type sender address is allowed. |
InvalidReceiverName.Malformed | The specified receiver name is wrongly formed. | 400 | The recipient list name is incorrect. The list does not exist or the list is empty. |
InvalidSendMail.Spam | Sendmail rejected by spam filter. | 400 | This mailing is detected as spam mailing by the anti-spam system and the email is forbidden from being sent. Check and optimize the email content. |
InvalidTemplateName.Malformed | The specified template name is wrongly formed. | 400 | The template name is incorrect. |
InvalidMailAddressDomain.Malformed | The specified mailAddress domain does not exist. | 400 | The domain status of the sender address is incorrect. Check the domain status, the ownership, MX and SPF configurations. |
Example
Request example
https://dm.aliyuncs.com/?Action=BatchSendMail
&AccountName=test@example.com
&AddressType=1
&TemplateName=test1
&ReceiversName=test2
&TagName=test3
&<Public request parameter>
Response example
XML format
<BatchSendMailResponse>
<RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
</BatchSendMailResponse>
JSON example
{
"RequestId": "12D086F6-8F31-4658-84C1-006DED011A85"
}