SendEmail
Before using this API, please prepare the following content in the console:
- Set up the custom domain name and verify that it passes.
- Set sender information.
Request Parameters
Field Name | Parameter Type | Describe | Require |
---|---|---|---|
Action | string | Value: SendEmail | Yes |
AccountId | int | Project ID. Get AccountId. | Yes |
SenderEmail | string | The email address that was configured in the console Sender Setting. | Yes |
EmailCoTargetEmailAddressntent | []string | Email receiving address.TargetEmail structure array with a length between 1 and 100. | Yes |
Subject | string | Email Subject. | Yes |
Content | string | Email Content. | Yes |
Response Parameters
Field Name | Parameter Type | Describe | Require |
---|---|---|---|
RetCode | int | When RetCode is not 0, the specific error description is displayed in Message. If RetCode is 0, Message will not be returned. | Yes |
Message | string | Return status code description. If the operation is successful, it will be returned as empty by default. | Yes |
SessionNo | string | The unique ID of this sending task.you can query the list of emails sent according to the value.Note:the field is returned only when the number of successfully submitted emails is greater than 0. | No |
SuccessCount | int | The number of successfully submitted emails. | No |
FailContent | []FailedTargetEmail | Details that were not sent successfully can be resent based on the field. | No |
FailedTargetEmail struct
Field Name | Parameter Type | Describe |
---|---|---|
EmailAddress | string | email receiving address |
FailureReason | string | the reason why submit failed.Note:if the template/domain/sender check failed, the field is empty. |
Request Example
curl 'https://api.uspeedo.com/api' \
--header 'X-AccessToken: eyJxxxxxxxxx1RI' \
--header 'Content-Type: application/json' \
--data-raw '{
"Action": "SendEmail",
"SendEmail": "send@example.com",
"TargetEmailAddress": ["recv@example.com"],
"Subject": "email subject",
"Content": "email content"
}'
Response Example
{
"Action": "SendEmailTemplateResponse",
"FailContent": [
{
"EmailAddress": "example@example.com",
"FailureReason": "reason"
}
],
"Message": "Success",
"RequestUuid": "bb7ee377-fa16-4df4-945a-0e624fc1316b",
"RetCode": 0,
"SessionNo": "6977469d-d6fc-47e1-ad46-67d866f80655",
"SuccessCount": 0
}