Attachments

Each item in the attachments array must include:

  • •filename (string, required): Name the recipient sees, including extension.
  • •content (string): Base64-encoded file content. Use this when sending generated files (PDFs, CSVs, images).
  • •path (string): Absolute server file path. Use only if your app runs on the same server as the API.

At least one of content or path is required per attachment. Maximum 10 attachments per request. The combined decoded size of all attachments must not exceed 25 MB; requests over this limit are rejected with 400 Bad Request.

Blocked file types

To protect recipients, Altermail rejects attachments with harmful or potentially malicious file extensions. Requests containing any blocked type will return a 400 error.

.exe .dll .bat .cmd .com .msi .msp .ps1 .psm1 .psd1 .vbs .vbe .js .jse .wsf .wsh .scr .pif .hta .cpl .jar .reg .inf .lnk .iso .img

Use safe, widely-supported formats such as .pdf, .png, .jpg, .csv, or .docx for your attachments.

curl -X POST https://api.altermail-console.com.ng/v1/user/email/send \
  -H "Content-Type: application/json" \
  -H "token: YOUR_API_KEY" \
  -d '{
    "email": "recipient@example.com",
    "fromEmail": "billing@yourdomain.com",
    "subject": "Your invoice #1042",
    "mailBodyHtml": "<p>Please find your invoice attached.</p>",
    "attachments": [
      {
        "filename": "invoice-1042.pdf",
        "content": "BASE64_ENCODED_FILE_CONTENT"
      }
    ]
  }'