We currently do not support sending attachments (including inline images)
when using our batch endpoint.
1
Add the CID in the email HTML.
Use the prefix
cid:
to reference the ID in the src
attribute of an image tag in the HTML body of the email.2
Reference the CID in the attachment
Include the The ID is an arbitrary string set by you, and must be less than 128 characters.
content_id
parameter in the attachment object (e.g. content_id: "logo-image"
).Implementation details
Both remote and local attachments are supported. All attachment requirements, options, and limitations apply to inline images as well. As with all our features, inline images are available across all our SDKs.Remote image example
Local image example
Other considerations
Before adding inline images, consider the following.- As these images are sent as attachments, you need to encode your image as Base64 when sending the raw content via the API. There is no need to do this when passing the path of a remote image (the API handles this for you).
- Inline images increase the size of the email.
- Inline images may be rejected by some clients (especially webmail).
- As with all attachments, we recommend adding a
content_type
(e.g.image/png
) orfilename
(e.g.logo.png
) parameter to the attachment object, as this often helps email clients render the attachment correctly.
All attachments (including inline images) do not currently display in the
emails dashboard when previewing email HTML.