Skip to main content

Send Email

Interface Description

Send emails directly without using templates. Supports batch sending to multiple recipients. All recipients will receive emails with the same content.

Request Information

  • Request Method: POST
  • Request Path: /api/v1/email/SendEmail
  • Content-Type: application/json

Request Parameters

Parameter NameTypeRequiredDescriptionExample Value
SendEmailstringYesSender email address"sender@example.com"
TargetEmailAddressarrayYesRecipient email address list, minimum 1, maximum 100["recipient1@example.com", "recipient2@example.com"]
SubjectstringYesEmail subject, length 1-200 characters"Welcome to USpeedo Email Service"
ContentstringYesEmail content, minimum 1 character"Email content"
FromNamestringNoSender nickname"USpeedo"

Notes

  • TargetEmailAddress array length is limited to 1-100 email addresses
  • Subject length is limited to 1-200 characters
  • Content requires at least 1 character and supports HTML format

Request Example

curl -X POST "https://api.uspeedo.com/api/v1/email/SendEmail" \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n 'ACCESSKEY_ID:ACCESSKEY_SECRET' | base64)" \
-d '{
"SendEmail": "sender@example.com",
"TargetEmailAddress": [
"recipient1@example.com",
"recipient2@example.com"
],
"Subject": "Welcome to USpeedo Email Service",
"Content": "<html><body><h1>Welcome</h1><p>This is a test email.</p></body></html>",
"FromName": "USpeedo"
}'

Response Format

Success Response

{
"RetCode": 0,
"Message": "success",
"SessionNo": "session_1234567890",
"FailedTargetEmails": []
}

Response Field Description

Field NameTypeDescription
RetCodeintReturn code, 0 indicates success
MessagestringReturn message
SessionNostringSession number, used to query sending status
FailedTargetEmailsarrayList of failed recipients, each element contains: EmailAddress (email address), FailureReason (failure reason)

Error Response

{
"RetCode": 215392,
"Message": "Invalid parameter [SendEmail]"
}

Common Error Codes

Error CodeDescription
0Success
215392Parameter error
215397Missing required parameter
215400Server error