Send 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 Direct Mail console. |
test***@example.net |
| AddressType |
integer |
Yes |
The address type. Valid values:
|
1 |
| TagName |
string |
No |
A tag for categorizing email batches, which you can create in the Direct Mail console. Tags allow you to query the sending status of each batch and are required if you enable email tracking. The tag must be 1 to 128 characters long and can contain letters, digits, underscores (_), and hyphens (-). |
test |
| ReplyToAddress |
boolean |
Yes |
Specifies whether to use the default reply-to address configured in the console. This address must be verified. Valid values: true, false. |
true |
| ToAddress |
string |
Yes |
The destination email address(es). To specify multiple addresses, separate them with commas (up to 100). |
test1***@example.net |
| Subject |
string |
Yes |
The subject of the email, with a maximum length of 256 characters. |
Subject |
| HtmlBody |
string |
No |
The HTML body of the email. Note: You must specify either
|
body |
| TextBody |
string |
No |
The text body of the email. Note: You must specify either
|
body |
| FromAlias |
string |
No |
The sender name. It must be 15 characters or shorter. For example, if you set the sender name to "Xiaohong" and the sender address is |
小红 |
| ReplyAddress |
string |
No |
The reply-to address. |
test2***@example.net |
| ReplyAddressAlias |
string |
No |
The name displayed for the reply-to address. |
小红 |
| ClickTrace |
string |
No |
Specifies whether to enable click tracking. Valid values: |
0 |
| UnSubscribeLinkType |
string |
No |
"google", "aol.com", "hotmail", "outlook", and "ymail.com". For more information, see Unsubscribe link generation and filtering mechanism. The display language is automatically determined based on the recipient's browser settings. |
default |
| UnSubscribeFilterLevel |
string |
No |
The filtering level. For more information, see Unsubscribe link generation and filtering mechanism.
|
mailfrom_domain |
| Headers |
string |
No |
Custom email header settings. Both standard and non-standard fields must comply with standard header syntax. You can specify up to 10 headers for an API call. Excess headers are ignored. This limit does not apply to SMTP. 1. Standard fields
Standard fields overwrite existing values in the email header. 2. Non-standard fields Case-insensitive. a. Fields starting with b. Fields starting with When pushed to EventBridge or MNS, the header object will contain these fields. |
{
"Message-ID": " |
| IpPoolId |
string |
No |
The ID of the dedicated IP pool. If you have purchased dedicated IPs, you can use this parameter to select which dedicated IP pool to use for sending the email. For more information, see Dedicated IP. |
e4xxxxxe-4xx0-4xx3-8xxa-74cxxxxx1cef |
| Attachments |
array<object> |
No |
This feature is available only through the latest SDKs. It is not supported for OpenAPI calls or signature-based authentication. For more information, see How do I send an email with an attachment by using an SDK?. |
|
|
object |
No |
An object representing a single attachment. |
||
| AttachmentName |
string |
No |
The filename of the attachment. |
test.txt |
| AttachmentUrl |
string |
No |
The local file path of the attachment that the SDK will use. |
C:\Users\Downloads\test.txt |
| Template |
object |
No |
The template information for sending a templated email. |
|
| TemplateId |
string |
No |
The template ID. |
xxx |
| TemplateData |
object |
No |
The variables and their values for the template. |
|
|
string |
No |
The parameters and values of the template variables. |
{ "name": "Tom", "age": "22" } |
|
| BccAddress |
string |
No |
Note: The |
1@example.com,2@example.com |
| DomainAuth |
boolean |
No |
Specifies whether to enable domain-level authentication.
This parameter is used only for domain-level authentication. Ignore it for sender address-level authentication. 1. Create the address 2. API scenario Set SMTP scenario a. Call the b. Authenticate with the domain and the configured password. Pass a custom address, such as |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| EnvId |
string |
Event ID. |
600000xxxxxxxxxx642 |
| RequestId |
string |
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. |
| 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.