Skip to content
Splashify Pro
Email docsEmail

Send with attachments

Three of the four send endpoints accept an attachments[] array — /send, /send-template, and /send-bulk. Each attachment carries the file bytes inline as base64; we build the multipart/mixed MIME structure for you, DKIM-sign it, and ship it to the recipient through the same pipeline as plain-body emails.

/send-raw always supported attachments because customers build the MIME themselves. See Send raw for that path.

Attachment object

Each entry in attachments[] is shaped like this:

json
{
  "filename":       "invoice-2026-04.pdf",
  "content_type":   "application/pdf",
  "content_base64": "<base64-encoded file bytes>",
  "content_id":     "logo-header",
  "inline":         false
}

Limits

Blocked file types

Executable + script extensions are refused at the API layer because recipient mail providers (Gmail, Outlook, corporate gateways) block them outright — sending one would cost a wallet deduction for a guaranteed bounce. Blocked extensions:

.exe .bat .cmd .com .scr .msi .vbs .vbe .js .jse .wsf .wsh .ps1 .dll .jar .app .sh .pl .py .lnk

Workaround: bundle them inside a .zip. ZIPs are allowed.

Example — single PDF

bash
ATT=$(base64 -i invoice.pdf | tr -d '\n')

curl https://api.splashifypro.com/api/v1/partner/email/send \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -d "{
    \"from\":      \"[email protected]\",
    \"to\":        [\"[email protected]\"],
    \"subject\":   \"Invoice for March\",
    \"html_body\": \"<p>Hi! Your invoice for March is attached.</p>\",
    \"attachments\": [
      {
        \"filename\":       \"invoice-march-2026.pdf\",
        \"content_type\":   \"application/pdf\",
        \"content_base64\": \"$ATT\"
      }
    ]
  }"

Example — Node.js (multiple files)

javascript
import { readFileSync } from 'node:fs'

const toAtt = (path, contentType) => ({
  filename:       path.split('/').pop(),
  content_type:   contentType,
  content_base64: readFileSync(path).toString('base64'),
})

const r = await fetch('https://api.splashifypro.com/api/v1/partner/email/send', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SPLASHIFY_API_KEY}`,
    'Content-Type':  'application/json',
  },
  body: JSON.stringify({
    from: '[email protected]',
    to:   ['[email protected]'],
    subject:   'Your March documents',
    html_body: '<p>Attached: invoice + receipt + signed contract.</p>',
    attachments: [
      toAtt('./invoice.pdf',  'application/pdf'),
      toAtt('./receipt.pdf',  'application/pdf'),
      toAtt('./contract.pdf', 'application/pdf'),
    ],
  }),
})
console.log(await r.json())

Example — Python

python
import base64, requests, os

def att(path, ct):
    with open(path, 'rb') as f:
        return {
            'filename':       os.path.basename(path),
            'content_type':   ct,
            'content_base64': base64.b64encode(f.read()).decode(),
        }

r = requests.post(
    'https://api.splashifypro.com/api/v1/partner/email/send',
    headers={'Authorization': f"Bearer {os.environ['SPLASHIFY_API_KEY']}"},
    json={
        'from': '[email protected]',
        'to':   ['[email protected]'],
        'subject':   'Attached photo',
        'html_body': '<p>Here\'s the photo from your visit.</p>',
        'attachments': [att('./photo.jpg', 'image/jpeg')],
    },
)
print(r.json())

Example — Inline image (CID reference)

When you want the image to render inside the email body instead of as a separate downloadable file, use inline: true + content_id, then reference it from your HTML with cid::

json
{
  "from":      "[email protected]",
  "to":        ["[email protected]"],
  "subject":   "Today's newsletter",
  "html_body": "<p>Welcome!</p><img src=\"cid:hero-banner\" />",
  "attachments": [
    {
      "filename":       "banner.png",
      "content_type":   "image/png",
      "content_base64": "iVBORw0KGgo…",
      "content_id":     "hero-banner",
      "inline":         true
    }
  ]
}

Most modern mail clients (Gmail web + mobile, Outlook, Apple Mail) render inline images correctly. A few hardened corporate gateways strip them — the file falls back to a regular attachment in those.

Errors

Pricing

Attachments do not incur a per-byte charge. You're billed at the per-recipient rate (₹0.03 per email, marketing or transactional) regardless of attachment size. The only practical cost is the 10 MiB total cap which limits how big each individual message can be.

Best practices

  • Compress where you can. A PDF with images compressed to 200 dpi vs 600 dpi can be 5× smaller and still look perfect at on-screen resolution. Smaller messages deliver faster + use less of your 10 MiB budget.
  • Use links for files > 5 MiB. Recipient mail providers throttle large messages and some flag them as suspicious. For anything bigger, host on object storage and put a download link in the body.
  • Set content_type explicitly when you can — saves us a filename-extension guess. The mail client's "open with" picker uses this header.
  • Prefer real filenames. Generic attachment.pdf is allowed but hurts deliverability slightly (Gmail's spam filter weights template-shaped filenames). invoice-march-2026.pdf is better.

Send-bulk semantics

When you call /send-bulk with attachments[], the same files are attached to every destination's email — there's no per-recipient attachment override. If you need different attachments per recipient, call /send-template once per recipient instead.