For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send email

Send a message from the managed mailbox. Saves a copy to INBOX.Sent.

Send email

post

Send a message from the managed mailbox. Saves a copy to INBOX.Sent.

Authorizations
AuthorizationstringRequired

Bearer authentication using API tokens in the Authorization header.

Path parameters
mailboxResourceIdstringRequired

Resource ID of the managed mailbox the bearer token is authorized for.

Example: AC1a2b3c4d5e6f7g
Body

Outgoing message payload. At least one of to, cc, or bcc must be present.

tostring · email[]Optional

Primary recipient email addresses.

Example: ["recipient@example.com"]
displayNamestringOptional

Sender display name shown in the From header alongside the mailbox address.

Example: John Doe
ccstring · email[]Optional

Carbon-copy recipient email addresses.

Example: ["cc@example.com"]
bccstring · email[]Optional

Blind-carbon-copy recipient email addresses. Not visible to other recipients.

Example: ["bcc@example.com"]
subjectstringOptional

Message subject line.

Example: Hello
textstringOptional

Plain-text body. Optional; if both text and html are omitted the message is sent without a body.

Example: Plain body
htmlstringOptional

HTML 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.

Example: <p>HTML body</p>
Responses
204

Message sent and saved to sent folder.

No content

post/api/v1/mailboxes/{mailboxResourceId}/send
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?