attachments array on the message, where each entry describes a single file.
The total size of all attachments must not exceed 50 MB per message. See Limits and overage rates for all sending limits.
Attachment fields
Each attachment is an object with three required fields:| Field | Type | Description |
|---|---|---|
fileName | string | Name the recipient will see, including the extension (e.g. report.pdf). |
contentType | string | Valid MIME type for the file, e.g. application/pdf or text/plain. |
content | string | The file contents, Base64-encoded. |
REST API example
Add theattachments array to the message body. The example below attaches a small text file (Hello World! Base64-encoded as SGVsbG8gV29ybGQh):
SDK examples
Most Paubox SDKs accept attachments in the samefileName / contentType / content shape. The file content is always Base64-encoded.
Sending from the CLI
The Paubox CLI accepts files directly with the--attachment flag and handles the Base64 encoding for you: