Email Sending API Documentation

Base URL

POST /send-email.php

Authentication

All requests require an Authorization header with a Bearer token:

Authorization: Bearer YOUR_SECURE_XXXXXXXXXXX

Request Body

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.

Example Request

{
    "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" }

Responses

Success

{
    "status": 1,
    "message": "Email sent successfully"
}

Error

{
    "status": 0,
    "message": "Unauthorized"
}
{
    "status": 0,
    "message": "Missing required fields"
}
{
    "status": 0,
    "message": "SMTP error details here"
}