All Products
Document Center

Direct Mail:SingleSendMail

Last Updated:Dec 10, 2020


SingleSendMail interface is used for sending single emails.

Request parameters

Name Type Required? Description
Action String Required Operation interface name, a system required parameter. Value: SingleSendMail.
AccountName String Required The sender address configured in the console.
ReplyToAddress String Required The reply-to address (The status must be “verified”) configured in the console. Values: “true”, “false”. String Format instead of Boolean.
AddressType Number Required Value range: 0-1. 0 indicates a random account, and 1 indicates the sender address.
ToAddress String Required The recipient address. Multiple addresses can be separated by commas, and a maximum of 100 addresses are supported.
FromAlias String Optional Sender nickname. The length of the nickname must be shorter than 15 characters. For example, the sender nickname is set to “Daisy”, and the sender address is “”. Recipients see the address of “‘Daisy’“.
Subject String Optional Subject (recommended).
HtmlBody String Optional Email body in HTML.
TextBody String Optional Email body in text.
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.
InvalidToAddress The specified toAddress is wrongly formed. 400 The recipient address is incorrect.
InvalidBody The specified textBody or htmlBody is wrongly formed. 400 The email body is incorrect. The textBody and htmlBody cannot be empty at the same time.
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. Carefully check the email content and the domain status.
InvalidSubject.Malformed The specified subject is wrongly formed. 400 The subject is limited within 100 characters.
InvalidMailAddressDomain.Malformed The specified mailAddress domain does not exist. 400 The domain status of the sender address is incorrect. Check the MX and SPF configuration.
InvalidFromALias.Malformed The specified fromAlias is wrongly formed. 400 The sender nickname is incorrect. Check the sender nickname, which must be shorter than 15 characters.


Request example

  2. &
  3. &ReplyToAddress=true
  4. &AddressType=1
  5. &
  6. &Subject=Subject
  7. &HtmlBody=body
  8. &<Public request parameter>

Response example

XML format

  1. <SingleSendMailResponse>
  2. <RequestId>12D086F6-8F31-4658-84C1-006DED011A85</RequestId>
  3. </SingleSendMailResponse>

JSON example

  1. {
  2. "RequestId": "12D086F6-8F31-4658-84C1-006DED011A85"
  3. }