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 Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| SendEmail | string | Yes | Sender email address | "sender@example.com" |
| TargetEmailAddress | array | Yes | Recipient email address list, minimum 1, maximum 100 | ["recipient1@example.com", "recipient2@example.com"] |
| Subject | string | Yes | Email subject, length 1-200 characters | "Welcome to USpeedo Email Service" |
| Content | string | Yes | Email content, minimum 1 character | "Email content" |
| FromName | string | No | Sender nickname | "USpeedo" |
Notes
TargetEmailAddressarray length is limited to 1-100 email addressesSubjectlength is limited to 1-200 charactersContentrequires 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 Name | Type | Description |
|---|---|---|
| RetCode | int | Return code, 0 indicates success |
| Message | string | Return message |
| SessionNo | string | Session number, used to query sending status |
| FailedTargetEmails | array | List of failed recipients, each element contains: EmailAddress (email address), FailureReason (failure reason) |
Error Response
{
"RetCode": 215392,
"Message": "Invalid parameter [SendEmail]"
}
Common Error Codes
| Error Code | Description |
|---|---|
| 0 | Success |
| 215392 | Parameter error |
| 215397 | Missing required parameter |
| 215400 | Server error |