HTTP API
认证:
http
Authorization: Bearer am_xxxxxxxxxxxx发送
http
POST /emailsjson
{
"provider_id": "smtp_provider_id",
"from": "示例 <hello@example.com>",
"to": ["user@example.com"],
"subject": "你好",
"html": "<p>测试邮件</p>"
}provider_id 为 SMTP 配置 ID。服务端也兼容旧字段 provider。
批量发送
http
POST /emails/batchjson
[
{
"provider_id": "smtp_provider_id",
"from": "hello@example.com",
"to": "user1@example.com",
"subject": "你好 1",
"text": "测试邮件 1"
},
{
"provider_id": "smtp_provider_id",
"from": "hello@example.com",
"to": "user2@example.com",
"subject": "你好 2",
"text": "测试邮件 2"
}
]SMTP 列表
http
GET /emails/providers查询
http
GET /emails/:id邮件列表
http
GET /emails?limit=10&after=email_id取消
http
POST /emails/:id/cancel
DELETE /emails/:id错误
json
{
"statusCode": 422,
"name": "validation_error",
"message": "provider_id is required"
}