You can call the BatchSendMail operation to send emails in batches.
Test
Request parameters
Name | Type | Required | Example | Description |
AccountName | String | Yes | test@example.com | The sender address configured in the console. |
AddressType | Integer | Yes | 1 |
|
ReceiversName | String | Yes | test2 | The name of a pre-created recipient list with uploaded recipients. Note: To prevent sending failures, wait at least 10 minutes after the task is triggered before you delete the recipient list. |
TemplateName | String | Yes | test1 | The name of a pre-created and approved template. |
Action | String | No | BatchSendMail | A required parameter. Set the value to BatchSendMail. |
ClickTrace | String | No | 0 |
|
TagName | String | No | test3 | The name of the email tag. |
ReplyAddress | String | No | test2***@example.net | The reply-to address. |
ReplyAddressAlias | String | No | Alice | The alias for the reply-to address. |
UnSubscribeLinkType | String | No | default | Specifies the type of unsubscribe link to generate. For more information, see the Unsubscribe feature instructions document.
"google", "aol.com", "hotmail", "outlook", or "ymail.com".
|
UnSubscribeFilterLevel | String | No | mailfrom_domain | Filter level. For more information, see Unsubscribe Feature Help.
|
Response parameters
Name | Type | Example | Description |
EnvId | String | xxx | The event ID. |
RequestId | String | 12D086F6-8F31-4658-84C1-006DED011A85 | The request ID. |
Examples
Request example
https://dm.aliyuncs.com/?Action=BatchSendMail
&AccountName=test@example.com
&AddressType=1
&ReceiversName=test2
&TemplateName=test1
&<Common request parameters>Successful response examples
XML format
<BatchSendMailResponse>
<RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
<EnvId>xxx</EnvId>
</BatchSendMailResponse>JSON format
{
"EnvId":"xxx",
"RequestId":"12D086F6-8F31-4658-84C1-006DED011A85"
}Error codes
HTTP status code | Error code | Error message | Description |
400 | InvalidMailAddressName.Malformed | The specified MailAddress name is wrongly formed. | The sender address is in an invalid format. The address must contain an at sign (@). The domain name can contain digits, letters, underscores (_), hyphens (-), and periods (.). The account name can contain digits, letters, underscores (_), hyphens (-), and periods (.). |
400 | InvalidReceiverName.Malformed | The specified receiver name is wrongly formed. | The recipient address is in an invalid format. The address must contain an at sign (@). The domain name can contain digits, letters, underscores (_), hyphens (-), and periods (.). The account name can contain digits, letters, underscores (_), hyphens (-), and periods (.). |
400 | InvalidTemplateName.Malformed | The specified template name is wrongly formed. | The template name is in an invalid format. The template name cannot exceed 30 characters in length. |
404 | InvalidMailAddress.NotFound | The specified mailAddress does not exist. | The specified sender address does not exist. Check the sender address. |
404 | InvalidTemplate.NotFound | The specified template does not exist. | The specified template does not exist. |
404 | InvalidReceiver.NotFound | The specified receiver does not exist. | The recipient does not exist. Check whether the recipient exists. |
400 | InvalidSendMail.Spam | Sendmail rejected by spam filter. | The email sending is denied. Check the user status for issues such as frequency limit exceeded or insufficient quota. |
400 | InvalidMailAddressSendType.Malformed | The specified mailAddress sendType is wrongly formed. | The sending type is invalid. Go to the console to check the type and set the value accordingly. |
400 | InvalidMailAddressStatus.Malformed | The specified mailAddress status is wrongly formed. | The sender address is in an invalid status. Check whether the address is active or frozen. |
400 | InvalidMailAddressDomain.Malformed | The specified mailAddress domain does not exist. | The domain name is in an invalid format. Use digits, letters, underscores (_), hyphens (-), and periods (.). |
400 | InvalidTemplateStatus.Malformed | The specified template status is wrongly formed. | The template is in an invalid status. Check whether the template is approved. |
400 | InvalidReceiverStatus.Malformed | The specified receivers status is wrongly formed. | The recipient status is invalid. Go to the console to check whether the recipients are uploaded. |
400 | InvalidReplyAddressAlias.Malformed | The specified replyAddressAlias is wrongly formed. | The alias for the reply-to address is in an invalid format. The alias cannot exceed 15 characters in length. |
400 | InvalidReplyAddress.Malformed | The specified replyAddress is wrongly formed. | The reply-to address is in an invalid format. The address must contain an at sign (@). The domain name can contain digits, letters, underscores (_), hyphens (-), and periods (.). The account name can contain digits, letters, underscores (_), hyphens (-), and periods (.). |
For a list of other error codes, visit the Error Center.