All Products
Search
Document Center

Direct Mail:BatchSendMail

Last Updated:Apr 22, 2024

Description

BatchSendMail is used for sending batch emails.

Request parameters

Parameter

Type

Required?

Example

Description

Action

String

Yes

BatchSendMail

Operation interface name, a system required parameter. Value: BatchSendMail.

AccountName

String

Yes

test***@example.net

The sender address configured in the console.

AddressType

Integer

Yes

1

Value range: 0-1. 0 indicates a random address, and 1 indicates the sender address.

TemplateName

String

Yes

test1

The name of the template that is created and verified in advance .

ReceiversName

String

Yes

test2

The name of the recipient list that is created in advance and uploaded with recipients.

TagName

String

No

test3

The mail tag name.

ClickTrace

String

No

0

Value range: 0-1. 1 indicates enabling recipient tracking. 0 indicates that not enabling recipient tracking. The default value of this parameter is 0.

ReplyAddress

String

No

test2***@example.net

The reply-to address.

ReplyAddressAlias

String

No

Lucy

The alias of reply-to address.

UnSubscribeLinkType

String

No

default

The type of the generated unsubscription link. For more information, please refer to The Description of the Unsubscription Function.

  • disabled:not generated.

  • default:uses the default policy: An unsubscription link is generated when the batch type of sender addresses send to a specific domain, such as Gmail, Yahoo, Google, aol.com, Hotmail, Outlook and Ymail.com.

  • zh-cn:generated, for implement tracking to content preparation in the future.

  • en-us:generated, for implement tracking to content preparation in the future.

UnSubscribeFilterLevel

String

No

mailfrom_domain

The filter level. For more information, please check The Description of the Unsubscription Function.

  • disabled:not filtered

  • default:uses the default policy: The batch type of sending addresses are filtered at the sending address level.

  • mailfrom: sending address level filtering

  • mailfrom_domain: sending domain-level filtering

  • edm_id: account-level filtering

For other request parameters, see Public parameters.

Response parameters

Parameter

Type

Example

Description

EnvId

String

xxxxxx

Event ID

RequestId

String

2D086F6-8F31-4658-84C1-006DED011A85

Request ID

For more information about public return parameters, see Public parameters.

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>1585FF95-1221-51AC-A3D7-C15D4AC1AECD</RequestId>
		<EnvId>600000007456651235</EnvId>
</BatchSendMailResponse>

JSON example

{
  "RequestId": "1585FF95-1221-51AC-A3D7-C15D4AC1AECD",
  "EnvId": "600000007456651235"
}

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.

For a list of error codes, visit the API Error Center.