POST /send-email.php
All requests require an Authorization header with a Bearer token:
Authorization: Bearer YOUR_SECURE_XXXXXXXXXXX
Send JSON data in the request body.
| Field | Type | Required | Description |
|---|---|---|---|
toEmail |
string (comma-separated) | Yes | Recipient email(s). |
subject |
string | Yes | Email subject. |
message |
string (HTML) | Yes | Email body content. |
smtpConfig |
object | Yes | SMTP configuration: host, username, password, port, secure, from_email, from_name (optional). |
attachment |
array | No | File paths to attach. |
ccEmail |
string (comma-separated) | No | CC recipients. |
bccEmail |
string (comma-separated) | No | BCC recipients. |
{
"toEmail": "john@example.com,jane@example.com",
"subject": "Test Email",
"message": "Hello
This is a test email.
",
"smtpConfig": {
"host": "smtp.example.com",
"username": "user@example.com",
"password": "secret",
"port": 587,
"secure": "tls",
"from_email": "noreply@example.com",
"from_name": "Example Sender"
},
"attachment": ["/path/to/file1.pdf"],
"ccEmail": "manager@example.com",
"bccEmail": "admin@example.com"
}
{
"status": 1,
"message": "Email sent successfully"
}
{
"status": 0,
"message": "Unauthorized"
}
{
"status": 0,
"message": "Missing required fields"
}
{
"status": 0,
"message": "SMTP error details here"
}