Send email
Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
Send a message from the managed mailbox. Saves a copy to INBOX.Sent.
Bearer authentication using API tokens in the Authorization header.
Resource ID of the managed mailbox the bearer token is authorized for.
AC1a2b3c4d5e6f7gOutgoing message payload. At least one of to, cc, or bcc must be present.
Primary recipient email addresses.
["recipient@example.com"]Sender display name shown in the From header alongside the mailbox address.
John DoeCarbon-copy recipient email addresses.
["cc@example.com"]Blind-carbon-copy recipient email addresses. Not visible to other recipients.
["bcc@example.com"]Message subject line.
HelloPlain-text body. Optional; if both text and html are omitted the message is sent without a body.
Plain bodyHTML body. Optional; if both text and html are omitted the message is sent without a body. Inline images are referenced via cid: URLs matching attachment cid values.
<p>HTML body</p>Message sent and saved to sent folder.
No content
Missing or invalid credentials.
Token is not authorized to manage the requested mailbox.
Request payload failed validation. params maps field name to an array of error messages.
Server-side failure.
Upstream service is unavailable or returned an unexpected response.
Upstream service did not respond within the configured timeout.
POST /api/v1/mailboxes/{mailboxResourceId}/send HTTP/1.1
Host: api.mail.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 389
{
"to": [
"recipient@example.com"
],
"displayName": "John Doe",
"cc": [
"cc@example.com"
],
"bcc": [
"bcc@example.com"
],
"subject": "Hello",
"text": "Plain body",
"html": "<p>HTML body</p>",
"attachments": [
{
"filename": "invoice.pdf",
"content": "JVBERi0xLjQK...",
"contentType": "application/pdf",
"cid": "logo",
"encoding": "base64"
}
],
"inReplyTo": {
"uid": 123,
"folder": "INBOX"
},
"forwardOf": {
"uid": 123,
"folder": "INBOX"
}
}No content
Last updated
Was this helpful?