Skip to main content
The turboSMTP API lets you attach files of any type to outbound emails by including them as Base64-encoded strings in the request body. You can send PDFs, images, spreadsheets, archives, or any other file format your recipients need: all in a single API call alongside your message content. To add attachments, include an attachments array in your /mail/send request body, where each element describes one file.

Attachment limits

The total size of your email, including all attachments, must be less than 24 MB. This limit covers the entire serialized message: headers, body, and all attachment content combined. Base64 encoding inflates binary files by approximately 33%, so a 16 MB binary file will produce roughly a 21 MB encoded string. Plan your attachment sizes accordingly.

Request format

Add an attachments array to your standard /mail/send request body. Each object in the array represents one attached file.
array
An array of attachment objects. Each object must include name, type, and content. Use content_id only for inline content.

Example with attachment

The following request sends an email with a single PDF attachment. Replace the content value with your actual Base64-encoded file data.
Send email with a PDF attachment
A successful response returns HTTP 200 and the message ID:
Success response

Supported file types

turboSMTP accepts any valid MIME type in the type field. The table below lists the most commonly used formats.

Multiple attachments

To include more than one file, add additional objects to the attachments array. Each object is independent: you can mix different file types in the same request.
Send email with multiple attachments
Remember that the combined encoded size of all attachments plus the rest of the email must remain under 24 MB. If you need to send large files, consider hosting them on a file storage service and linking to them in the email body instead.

Inline images

Include an image in attachments with a bare content_id, such as logo. turboSMTP appends the sender’s domain to the MIME Content-ID. The HTML must therefore use cid:logo@example.com when the sender is sender@example.com. A bare cid:logo will not match the delivered image.
Message with an inline image
Replace content with the image’s Base64 bytes, without a data:image/...;base64, prefix. Omit content_id to send a normal downloadable attachment. Use the same body at https://api.turbo-smtp.com/api/v2/mail/send or the EU host https://api.eu.turbo-smtp.com/api/v2/mail/send, authenticated with both Consumer headers.