All Products
Search
Document Center

:BatchSendMail

Last Updated:Oct 29, 2025

You can call the BatchSendMail operation to send emails in batches.

Test

You can run this operation directly in OpenAPI Explorer. This eliminates the need to calculate signatures. After a successful call, OpenAPI Explorer automatically generates SDK code examples.

Request parameters

Name

Type

Required

Example

Description

AccountName

String

Yes

test@example.com

The sender address configured in the console.

AddressType

Integer

Yes

1

  • 0: Random account

  • 1: Sender address

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

  • 1: Enables data tracking.

  • 0 (default): Disables data tracking.

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.

  • Disabled: Generation is disabled.

  • default: Uses the default policy. An unsubscribe link is generated when you send emails from a batch sender address to specific domains, such as domains that contain keywords like "gmail", "yahoo",

"google", "aol.com", "hotmail",

"outlook", or "ymail.com".

  • Generated for future instrumentation.

  • en-us: Generates a link. This is reserved for future content instrumentation.

UnSubscribeFilterLevel

String

No

mailfrom_domain

Filter level. For more information, see Unsubscribe Feature Help.

  • disabled: No filtering.

  • default: Uses the default policy. Batch sender addresses are filtered at the sender address level.

  • mailfrom: Filters at the sender address level.

  • mailfrom_domain: Filters at the email domain level.

  • edm_id: Filters at the account level.

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.