PlunkPlunk
Core Concepts

Email Attachments

Send files with emails

Limits

  • Max 10 attachments per email
  • Max 10MB total size
  • Any file type supported

API usage

{
  "to": "user@example.com",
  "subject": "Your Invoice",
  "body": "<p>Invoice attached.</p>",
  "attachments": [
    {
      "filename": "invoice.pdf",
      "content": "JVBERi0xLjQK...",
      "contentType": "application/pdf"
    }
  ]
}

Attachment fields

FieldDescription
filenameDisplay name (max 255 chars)
contentBase64-encoded file content
contentTypeMIME type (e.g., application/pdf)

Base64 encoding

import fs from 'fs';

const fileBuffer = fs.readFileSync('invoice.pdf');
const base64Content = fileBuffer.toString('base64');