Skip to main content

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 NameParameter TypeDescribeRequire
ActionstringValue: SendEmailYes
AccountIdintProject ID. Get AccountId.Yes
SenderEmailstringThe email address that was configured in the console Sender Setting.Yes
EmailCoTargetEmailAddressntent[]stringEmail receiving address.TargetEmail structure array with a length between 1 and 100.Yes
SubjectstringEmail Subject.Yes
ContentstringEmail Content.Yes

Response Parameters

Field NameParameter TypeDescribeRequire
RetCodeintWhen RetCode is not 0, the specific error description is displayed in Message. If RetCode is 0, Message will not be returned.Yes
MessagestringReturn status code description. If the operation is successful, it will be returned as empty by default.Yes
SessionNostringThe 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
SuccessCountintThe number of successfully submitted emails.No
FailContent[]FailedTargetEmailDetails that were not sent successfully can be resent based on the field.No
FailedTargetEmail struct
Field NameParameter TypeDescribe
EmailAddressstringemail receiving address
FailureReasonstringthe 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
}