All Products
Search
Document Center

Direct Mail:SingleSendMail

Last Updated:Apr 22, 2024

Description

SingleSendMail interface is used for sending single emails.

Request parameters

Parameter

Type

Required?

Example

Description

Action

String

Yes

SingleSendMail

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

AccountName

String

Yes

test***@example.net

The sender address configured in the console.

ReplyToAddress

String

Yes

true

The reply-to address (The status must be "verified") configured in the console. Values: "true", "false". String Format instead of Boolean.

AddressType

Integer

Yes

1

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

ToAddress

String

Yes

test1***@example.net

The recipient address. Multiple addresses can be separated by commas, and a maximum of 100 addresses are supported.

FromAlias

String

No

Lucy

Sender nickname. The length of the nickname must be shorter than 15 characters. For example, the sender nickname is set to "Lucy", and the sender address is "test@example.com". Recipients see the address of "Lucy" <test@example.com>.

Subject

String

Yes

Subject

Subject (recommended).

HtmlBody

String

No

body

The message HtmlBody, SDK limit of 80K. Note: HtmlBody and TextBody are specific to different types of mail content, and one of the two fields must be required.

TextBody

String

No

body

The message TextBody, SDK limit of 80K. Note: HtmlBody and TextBody are specific to different types of mail content, and one of the two fields must be required.

ClickTrace

String

No

0

Value range: 0-1.

1 indicates enabling recipient tracking.

0 indicates not enabling recipient tracking.

The default value of this parameter is 0.

TagName

String

No

test

Tag name created by the DirectMail console

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 Returned results.

Example

Request example

https://dm.aliyuncs.com/?Action=SingleSendMail
&AccountName=test@example.com
&ReplyToAddress=true
&AddressType=1   
&ToAddress=test1@example.com
&Subject=Subject
&HtmlBody=body
&<Public request parameter>

Response example

XML format

<SingleSendMailResponse>
    <RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
    <EnvId>600000007399162333</EnvId>
</SingleSendMailResponse>

JSON example

{
  "RequestId": "0C51826F-3799-5AA2-AEED-739C90E18348",
  "EnvId": "600000007399162333"
}

Error codes

HttpCode

Error code

Description

Meaning

400

InvalidReceiverName.Malformed

The specified receiver name is wrongly formed.

The format of the recipient is incorrect. It must have the @ sign. The domain name consists of numbers, letters, underscores, minus signs and dots. The account number consists of numbers, letters, underscores, minus signs and dots.

404

InvalidMailAddress.NotFound

The specified mail address is not found.

The sender address does not exist.

400

InvalidToAddress

The specified toAddress is wrongly formed.

The recipient address is incorrect.The @ sign is required. The domain name consists of numbers, letters, underscores, minus signs and dots. The account number consists of numbers, letters, underscores, minus signs and dots.

400

InvalidToAddress.Spam

Sendmail rejected by invalid address.

Invalid address, please check the address validity.

400

InvalidBody

The specified textBody or htmlBody is wrongly formed.

The email body is incorrect. The textBody and htmlBody cannot be empty at the same time.

400

InvalidSendMail.Spam

Sendmail rejected by spam filter.

This mailing is detected as spam mailing by the anti-spam system and the email is forbidden from being sent. Carefully check the email content and the domain status.

400

InvalidMailAddressSendType.Malformed

The specified mailAddress sendType is wrongly formed.

The sending type is incorrect. Please go to the console to check the type and set the corresponding value.

400

InvalidMailAddressStatus.Malformed

The specified mailAddress status is wrongly formed.

The sender address status is incorrect. Please check whether it is available and frozen.

400

InvalidMailAddressDomain.Malformed

The specified mail address is not found.

The domain status of the sender address is incorrect. Check the MX and SPF configuration.

400

InvalidSubject.Malformed

The specified subject is wrongly formed.

The subject is limited within 100 characters.

400

InvalidFromAlias.Malformed

The specified fromAlias is wrongly formed.

The sender alias is in wrong format, and its length is no more than 15 characters.

400

InvalidReplyAddressAlias.Malformed

The specified replyAddressAlias is wrongly formed.

The format of the replyAddressAlias is incorrect, and the length should not exceed 15 characters.

400

InvalidReplyAddress.Malformed

The specified replyAddress is wrongly formed.

The replyAddress format is incorrect. It must have the @ sign. The domain name consists of numbers, letters, underscores, minus signs and dots. The account number consists of numbers, letters, underscores, minus signs and dots.

404

InvalidIP.NotFound

The specified IP address is invalid.

The specified IP is invalid. If you have enabled IP protection, please ensure that the IP address is in the list.

400

InvalidFromALias.Malformed

The specified fromAlias is wrongly formed.

The sender nickname is incorrect. Check the sender nickname, which must be shorter than 15 characters.

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