Sends a single email.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dm:SingleSendMail |
none |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AccountName |
string |
Yes |
The sender address configured in the console. |
test***@example.net |
| AddressType |
integer |
Yes |
The address type. Valid values: 0: Random account 1: Sender address |
1 |
| TagName |
string |
No |
The tag created in the Direct Mail console. It is used to classify email batches. You can use tags to query the sending status of each batch. If you enable email tracking, you must use an email tag for sending. The tag must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). |
test |
| ReplyToAddress |
boolean |
Yes |
Specifies whether to use the reply-to address that is configured and verified in the console. Valid values are the strings 'true' and 'false'. |
true |
| ToAddress |
string |
Yes |
The destination address. You can specify multiple email addresses separated by commas. A maximum of 100 addresses are supported. Address lists are also supported. |
test1***@example.net |
| Subject |
string |
Yes |
The email subject. The subject can be up to 256 characters long. |
Subject |
| HtmlBody |
string |
No |
The HTML body of the email. Note: HtmlBody and TextBody are for different types of email content. You must specify one of them.
|
body |
| TextBody |
string |
No |
The text body of the email. Note: HtmlBody and TextBody are for different types of email content. You must specify one of them.
|
body |
| FromAlias |
string |
No |
The sender's nickname. The nickname must be less than 15 characters long. For example, if you set the nickname to 'Xiao Hong' and the sender address is test***@example.net, the recipient sees the sender as 'Xiao Hong' <test***@example.net>. |
小红 |
| ReplyAddress |
string |
No |
The reply-to address. |
test2***@example.net |
| ReplyAddressAlias |
string |
No |
The nickname for the reply-to address. |
小红 |
| ClickTrace |
string |
No |
1: Enables data tracking. 0 (default): Disables data tracking. |
0 |
| UnSubscribeLinkType |
string |
No |
default: Uses the default policy. An unsubscribe link is generated when sending emails from a batch-type sender address to specific domains, such as those containing keywords like "gmail", "yahoo", "google", "aol.com", "hotmail", "outlook", or "ymail.com". For more information, see Unsubscribe link generation and filtering mechanism. zh-cn: Generates a link for future content instrumentation. en-us: Generates a link for future content instrumentation. Generated to prepare for future content instrumentation. Generate to prepare for future content instrumentation. |
default |
| UnSubscribeFilterLevel |
string |
No |
The filtering level. For more information, see Unsubscribe link generation and filtering mechanism. disabled: No filtering. default: Uses the default policy. Batch 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. |
mailfrom_domain |
| Headers |
string |
No |
The standard fields that you can add to the message header are Message-ID, List-Unsubscribe, and List-Unsubscribe-Post. Standard fields overwrite existing values in the message header. Non-standard fields must start with X-User- and are appended to the message header. You can pass up to 10 message headers in JSON format. Both standard and non-standard fields must comply with the standard header syntax. |
{
"Message-ID": " |
| IpPoolId |
string |
No |
The ID of the dedicated IP address pool. If you have purchased dedicated IP addresses, you can use this parameter to specify the outbound IP address for this email. For more information, see Dedicated IPs. |
e4xxxxxe-4xx0-4xx3-8xxa-74cxxxxx1cef |
| Attachments |
array<object> |
No |
This feature is only available if you download and use the latest software development kit (SDK). It is not supported for OpenAPI calls or signature-based authentication. For more information, see How do I send an email with attachments using an SDK?. |
|
|
object |
No |
This feature is only available if you use the latest SDK. It is not supported for OpenAPI calls or signature-based authentication. |
||
| AttachmentName |
string |
No |
This feature is only available if you use the latest SDK. It is not supported for OpenAPI calls or signature-based authentication. |
test.txt |
| AttachmentUrl |
string |
No |
This feature is only available if you use the latest SDK. It is not supported for OpenAPI calls or signature-based authentication. |
C:\Users\Downloads\test.txt |
| Template |
object |
No |
Template information for sending templated emails. |
|
| TemplateId |
string |
No |
The template ID. |
xxx |
| TemplateData |
object |
No |
The template variables and their values. |
|
|
string |
No |
The parameter variable. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| EnvId |
string |
The event ID. |
600000xxxxxxxxxx642 |
| RequestId |
string |
The request ID. |
2D086F6-xxxx-xxxx-xxxx-006DED011A85 |
Examples
Success response
JSON format
{
"EnvId": "600000xxxxxxxxxx642",
"RequestId": "2D086F6-xxxx-xxxx-xxxx-006DED011A85"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidReceiverName.Malformed | The format of the receiver name is invalid. It must contain the @ sign. The domain must only contain numbers, letters, underscores, minus signs, and periods. The account name must only contain numbers, letters, underscores, minus signs, and periods. | The format of the receiver name is invalid. It must contain the @ sign. The domain must only contain numbers, letters, underscores, minus signs, and periods. The account name must only contain numbers, letters, underscores, minus signs, and periods. |
| 400 | InvalidSubject.Malformed | The specified subject is invalid. It must not exceed 100 characters. | The specified subject is invalid. It must not exceed 100 characters. |
| 404 | InvalidMailAddress.NotFound | The specified mail address is not found. | The specified mail address is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.