Send Email

Send emails with attachments and custom headers

Authentication

All API requests require authentication using a bearer token in the Authorization header.

Format: `Bearer YOUR_API_KEY`

Request

Body Parameters

Sender email address Recipient email address(es). Multiple recipients can be specified using commas. Can include names in format: `Name ` Email subject line HTML content of the email Sender name Reply-to email address. Can include name in format: `Name ` Array of attachment objects Base64 encoded file content
<ParamField body="filename" type="string">
  Name of the file including extension
</ParamField>
Custom email headers Unsubscribe URL
<ParamField body="X-Priority" type="string">
  Email priority level
</ParamField>

<ParamField body="X-Campaign-ID" type="string">
  Campaign identifier
</ParamField>

Response

Indicates if the email was sent successfully Unique identifier for the sent email

Examples

Basic Email

curl -X POST 'https://api.shoutbox.email/send' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "sender@yourdomain.com",
    "to": "recipient@example.com",
    "subject": "Hello World",
    "html": "<h1>Welcome!</h1>"
  }'
{
  "success": true,
  "message_id": "msg_123abc456def"
}

Email with Attachments and Headers

curl -X POST 'https://api.shoutbox.email/send' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "reports@yourdomain.com",
    "name": "Reports Team",
    "to": "John Smith <john@example.com>",
    "reply_to": "Support Team <support@yourdomain.com>",
    "subject": "Monthly Report",
    "html": "<h1>Monthly Report</h1><p>Please find your report attached.</p>",
    "attachments": [
      {
        "content": "VGhpcyBpcyBhbiBhdHRhY2htZW50IQo=",
        "filename": "report.pdf"
      }
    ],
    "headers": {
      "X-Priority": "1",
      "X-Campaign-ID": "monthly_report_2024"
    }
  }'
{
  "success": true,
  "message_id": "msg_789xyz012uvw"
}