Brevo (formerly Sendinblue) says that inline images are not supported in transactional email. In my tests they work in Gmail, Outlook.com and HEY: attach the image and reference it in the HTML as cid: followed by the attachment’s file name.
<img src="cid:company-logo.png" />Brevo does not document this. The rest of this post shows the tests, the change it needs in your code and the limits I know of.
Why inline images instead of hosted URLs
I ran into this while moving a .NET application’s transactional email from Azure Communication Services (ACS) Email, which Microsoft is retiring, to Brevo. The email layout has three branding images: a banner, a product wordmark and a company logo. With ACS we sent them as inline (embedded) attachments and referenced them by Content-ID:
message.Attachments.Add( new EmailAttachment(image.FileName, image.ContentType, BinaryData.FromBytes(image.Content)) { ContentId = image.ContentId // e.g. "company-logo" });// markup: <img src="cid:company-logo">We use cid: because the alternatives are worse for a first-contact email. Gmail does not render data: URIs. Outlook and similar clients block remote images until the reader allows them, so with hosted URLs the branding is missing in the first email a user ever receives from you.
Brevo’s docs say inline images are not supported
- The attachment object in
POST /v3/smtp/emailhas three fields:url,contentandname. There is no Content-ID field and no inline flag. - A Brevo staff member wrote in the community forum that embedding images with a CID header is not supported for transactional email, through the API or SMTP.
- Anymail’s Brevo page states that “Brevo’s v3 API doesn’t support inline images, at all”, confirmed with Brevo support in 2018.
- The Brevo FAQ recommends hosted absolute image URLs.
Testing cid: with the attachment file name
The first test was one email with one attachment, company-logo.png, referenced twice: as cid:company-logo.png and as cid:company-logo, the Content-ID we used with ACS. In HEY the first reference showed the logo and the second was blank.
The second test used the three images of the real layout, one JPEG and two PNGs. Each was attached under a prefixed name and referenced by exactly that name. A fourth reference without the file extension served as a control that should not render. Reduced to the relevant fields, the request was:
{ "subject": "cid test", "htmlContent": "<img src=\"cid:acme-mail-hero-banner.jpg\"> <img src=\"cid:acme-mail-brand-wordmark.png\"> <img src=\"cid:acme-mail-company-logo.png\"> <img src=\"cid:acme-mail-company-logo\" alt=\"control\">", "attachment": [ { "name": "acme-mail-hero-banner.jpg", "content": "<base64>" }, { "name": "acme-mail-brand-wordmark.png", "content": "<base64>" }, { "name": "acme-mail-company-logo.png", "content": "<base64>" } ]}I sent it to four mailboxes:
| Mailbox | Matching references | Control | Where it landed |
|---|---|---|---|
| Gmail (web) | Rendered inline | Broken image with alt text | Inbox |
| HEY | Rendered inline | Blank | Inbox |
| Outlook.com (web) | Rendered inline after moving it to the inbox | Not checked | Junk, images blocked |
| Microsoft 365 | Not seen | Not seen | Not in the inbox or Junk |
The banner and the logo were visible in all three clients. The wordmark is white on a transparent background, so on the white test page I could not see it; I count it as not confirmed.
Two conclusions follow. Brevo links every cid: reference that equals an attachment’s name to that attachment, and it does so for several attachments in one message. The match has to be exact, extension included: the control differed only by the missing .png and did not render.
The Outlook.com and Microsoft 365 rows are about the sender, not about the images. I sent from a free-mail address whose domain publishes a DMARC policy of p=quarantine and does not authorize Brevo. Outlook.com put the message in Junk as an unverified sender and blocked its images until I moved it to the inbox. Microsoft 365 accepted the message, but it reached neither the inbox nor Junk, which points to quarantine. I have not confirmed that.
Checking a send without opening it
Brevo stores the body of each transactional email. GET /v3/smtp/emails?email=<recipient> lists the sent messages with their uuid, and GET /v3/smtp/emails/{uuid} returns the stored body.
In that body, a matched image appears with the image data embedded. An unmatched reference stays a cid: reference, with a generated id of the form cid:<date>.<n>@mail.0 instead of the value you sent. So any cid: left in the stored HTML is an image that will render blank, which makes this a check you can automate after a test send.
The change in your code
The Content-ID becomes the file name, and the attachment is sent under that name:
// beforenew BrandingAsset(ContentId: "company-logo", FileName: "company-logo.png", MimeType: "image/png");// afternew BrandingAsset(ContentId: "acme-mail-company-logo.png", FileName: "acme-mail-company-logo.png", MimeType: "image/png");The acme-mail- prefix is there for a reason that the next section explains.
Limits
Use file names that cannot occur anywhere else in the HTML. In the first test Brevo replaced the file name in my caption text and in alt attributes too, not only in src. A name like logo.png is likely to appear in an alt text or a link; acme-mail-company-logo.png is not.
The behavior is undocumented, so it can change without notice. Keep a mode in your code that switches to hosted image URLs.
If you need documented support
SendGrid, Postmark, Mailgun and Resend document Content-ID support for inline images. We stayed with Brevo for EU hosting and price, and keep the hosted-URL mode in case the behavior changes.
