Validate SMTP
POST
/web/v1/notification/email/validate/smtp WEBValidates an SMTP email server configuration by attempting to connect and authenticate.
Required Headers
| Header | Example Value | Description |
|---|---|---|
| Content-Type | application/json | Request content type |
| Accept | application/json | Expected response type |
| X-Client-Hash | Client device fingerprint | |
| Accept-Language | en, zh, zh-Hant, ja, vi | Response language (default: en) |
| Authorization | Bearer | JWT access token |
Request Parameters
Query Parameters
| Name | Type | Required | In | Description |
|---|---|---|---|---|
requestId | string | Required | query | Unique request ID for idempotency/tracking |
Request Body
EmailValidationRequest:
| Name | Type | Required | In | Description |
|---|---|---|---|---|
channelHost | string | Required | body | Notification channel host/access endpoint |
config | object | Required | body | Email channel configuration to validate |
config.smtpHost | string | Required | body | SMTP server hostname |
config.smtpPort | integer | Required | body | SMTP server port (1-65535) |
config.senderEmail | string | Required | body | Sender email address |
config.senderName | string | Required | body | Sender display name |
config.username | string | Required | body | SMTP authentication username |
config.password | string | Required | body | SMTP authentication password |
config.useSsl | boolean | Optional | body | Use SSL (default: true) |
config.useStartTls | boolean | Optional | body | Use STARTTLS (default: false) |
config.connectionTimeout | integer | Optional | body | Connection timeout in ms (default: 10000) |
config.readTimeout | integer | Optional | body | Read timeout in ms (default: 30000) |
Success Response
Success 200
{
"code": "2000",
"message": "SUCCESS",
"data": {
"valid": true,
"results": {
"SMTP": {
"success": true,
"serverHost": "smtp.example.com",
"serverPort": 587,
"connectionTimeMs": 245,
"errorCode": null,
"errorMessage": null
}
}
}
}Error Responses
| Code | Description |
|---|---|
4000 | Validation error (missing required config fields) |
4010 | Unauthorized (invalid or missing JWT token) |
4030 | Turnstile verification failed |
Notes
- This endpoint tests the SMTP connection only. Use the IMAP validation endpoint to test IMAP connectivity.
- The
requestIdquery parameter can be used for idempotency and request tracking. - A successful validation does not create or modify any channel.