Skip to documentation

Emails

Inline images

Embed images using Content-ID attachments.

How it works

Add the image as an attachment with a content_id, then reference that ID from your HTML with cid:.

Example

json
{
  "html": "<img src=\"cid:logo\" alt=\"Acme\" />",
  "attachments": [
    {
      "filename": "logo.png",
      "content": "BASE64_IMAGE",
      "content_type": "image/png",
      "content_id": "logo"
    }
  ]
}

Replace BASE64_IMAGE with the image's base64 content.

Things to know

A Content ID must be non-empty, at most 78 characters, and contain no whitespace or angle brackets. Inline images count toward the same attachment and message-size limits as other attachments.