⚠ Deprecated endpoint. The direct /sendmail service is no longer exposed publicly. Use POST /panel/api/mail/send instead — a Bearer token and active licence are required. See the interactive API reference for full details.

Mail API Documentation

This API allows you to send emails using PHPMailer. You can configure all PHPMailer public properties and methods (except send) via JSON. The API will enqueue the email for asynchronous processing.

Endpoint: /panel/api/mail/send

The endpoint accepts a JSON body with the following structure:

Request Structure

{ "emails":[ { "isSMTP": null, "Host": "smtp.example.com", "SMTPAuth": true, "Username": "user@example.com", "Password": "yourpassword", "SMTPSecure": "tls", "Port": 587, "setFrom": { "address": "user@example.com", "name": "Sender Name" }, "addAddress": { "address": "recipient@example.com", "name": "Recipient Name" }, "Subject": "Test Email", "Body": "This is a test email.", "isHTML": true, "addStringAttachment": { "string": "file contents", "filename": "file.txt", "encoding": "base64", "type": "text/plain", "disposition": "attachment" }, "callBackUrl": "callback url" } ] }

Parameters

Supported Methods and Properties

The following PHPMailer methods and properties are supported. For a full list, see the PHPMailer documentation.

Name Type Named Parameters / Value Description
isSMTPmethodnullEnable SMTP mode
HostpropertystringSMTP server hostname
SMTPAuthpropertyboolEnable SMTP authentication
UsernamepropertystringSMTP username
PasswordpropertystringSMTP password
SMTPSecurepropertystring ("tls" or "ssl")Encryption system to use
PortpropertyintSMTP port
setFrommethod{ "address": string, "name": string (optional) }Set sender address and name
addAddressmethod{ "address": string, "name": string (optional) }Add recipient address and name
addCCmethod{ "address": string, "name": string (optional) }Add CC address and name
addBCCmethod{ "address": string, "name": string (optional) }Add BCC address and name
addReplyTomethod{ "address": string, "name": string (optional) }Add reply-to address and name
SubjectpropertystringEmail subject
BodypropertystringEmail body (HTML or plain text)
AltBodypropertystringAlternative plain-text body
isHTMLpropertyboolSet to true to send HTML email
addStringAttachmentmethod{ "string": string, "filename": string, "encoding": "base64", "type": string, "disposition": "attachment" }Attach file content directly (preferred over addAttachment)
PrioritypropertyintEmail priority (1 = High, 3 = Normal, 5 = Low)
CharSetpropertystringCharacter set (e.g. "UTF-8")
WordWrappropertyintWord wrap length
addCustomHeadermethod{ "name": string, "value": string }Add a custom header

Example Response

{ "success": true, "data": [ { "messageId": "asd-123-adfasd", "status": "success | error", "email": "example@mailexample.xmp" } ], "message": "", "statusCode": 200 }
Note: