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
| Field | Description |
|---|---|
filename | Display name (max 255 chars) |
content | Base64-encoded file content |
contentType | MIME type (e.g., application/pdf) |
Base64 encoding
import fs from 'fs';
const fileBuffer = fs.readFileSync('invoice.pdf');
const base64Content = fileBuffer.toString('base64');