What is “Content-ID” and how does it reference inline images?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

A Content-ID (or CID) is a unique identifier for a file that's embedded directly inside an email. It lets you reference an image or other file in your HTML without hosting it on a web server.

Here's how it works. When you embed an image in an email's MIME structure, you give that file a Content-ID header (something like Content-ID: <logo123@example.com>). Then in your HTML body, you reference it with <img src="cid:logo123@example.com">. The email client matches the cid: reference to the embedded file and displays it inline.

The practical effect: the image appears inside the email as if it's part of the message itself, not loaded from an external URL. No tracking pixel, no broken image if your web server goes down, no privacy concern from loading remote content.

When would you actually use this? Almost never in modern email marketing. Most ESPs (like Mailchimp, Brevo, Klaviyo) host images on their CDNs and use regular src="https://..." URLs instead. Content-ID embedding makes your email file size larger, which can cause delivery problems or clipping in Gmail. And you lose the ability to track image loads (which is how most open tracking works).

Content-ID is still common in transactional email from custom SMTP setups, especially for things like embedded company logos in automated receipts. It's also useful if you're sending email in environments where external image loading is blocked by default (some corporate inboxes). But for newsletters and marketing campaigns, hosting images externally is the standard approach.

One gotcha: if you're building emails by hand and want to use Content-ID, make sure the ID you assign in the MIME part exactly matches the cid: reference in your HTML (including the angle brackets in the header). Mismatches will break the image display. Most email builders handle this automatically, so you'd only run into this if you're constructing raw MIME messages yourself.

If you're debugging an email and see cid: references in the HTML source, that's what this is. Check the raw MIME structure to find the matching Content-ID headers. You can use our Source Analyzer to parse the MIME parts and see how everything's connected.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Get personalized help with inline images

I read this on the Email Almanac about Content-ID and inline image references: "A Content-ID is a unique identifier for a file embedded directly inside an email. You reference it in HTML with src='cid:filename', and the email client matches that to the embedded file." Help me understand how this applies to MY specific situation. I need: 1. Whether I should use Content-ID embedding or host images externally 2. How to check if my current emails use Content-ID or remote URLs 3. Trade-offs between embedded images (Content-ID) and hosted images for my use case 4. How to debug broken inline images if I'm using Content-ID --- My details (fill in what applies): - Email platform/ESP: e.g. custom SMTP, Mailchimp, Postmark, SendGrid - Email type: transactional, marketing, newsletter - Current image hosting: ESP CDN, own server, embedded, not sure - Issue I'm facing: [images not displaying, file size too large, tracking not working] - Technical comfort: beginner / intermediate / advanced

Edit the yellow boxes, then send to the AI of your choice.