Home Resources Blog

Using data URIs to embed images in email has continued to attract a respectable amount of interest since our original post in 2008. While the results then were disappointing, we thought we’d give them a refresh to see if it’s now a viable workaround for those who can’t stand image blocking in email clients.

First, I personally have to admit that I’ve always approached image embedding with a sour dollop of skepticism, given this technique’s track record of:

  • Sloppy support in email clients
  • Producing large email file sizes, since the image data is embedded in the HTML file as a huge text string
  • Adding attachments to the email message (when images are embedded as a data URI in MIME Multipart/Related content)
  • Being a technique used by spammers (and penalized by spam filters)

Nonetheless, its popularity has endured, generally because of the promise that embedding is a legitimate workaround to image blocking in email clients. But is this still true now?

The lowdown on inline embedding

Before we go elbows-deep into the results, it’s worth mentioning that we’re going to look at support for inline embedded images only. Unlike the aforementioned MIME Multipart/Related content method, this is something you can try at home, in your Campaign Monitor account, without having to source your own scripts or specialized tools. However, if you’re comfortable with rolling-your-own multipart messages, you’re more than welcome to share your experiences with us in the comments below.

To get testing, we base64 encoded a JPEG image, as per the recipe described here. The resulting text string looked something like this:

<img alt="Embedded Image" height="128" width="128" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD....snip..." />

Using this hot mess, we added the image to an email and tested away. Sadly, the results across the most popular email clients were almost as choppy as before:

Email client Embedded image displays? Comments
iOS Mail Yes
Outlook 2003 Yes All images blocked by default
Outlook 2007+ No ALT text is replaced by ‘Linked image cannot be displayed’ in 2010+
All images blocked by default
Outlook.com (Hotmail) No Grey ‘blocked image’ placeholder displays, no ALT text
All images blocked by default
Apple Mail Yes
Yahoo! Mail No Placeholder and ALT text display
All images blocked by default
Gmail No Placeholder and ALT text display
All images blocked by default
Android default Yes All images blocked by default

The word is out – embedded images in email do not evade image blocking. In the case of ‘the Outlooks’1 above, not only were the images blocked, but they largely remained blocked, even when the other images in a newsletter were downloaded. The majority of email clients which reliably display embedded images (being Apple and iOS Mail) don’t block images by default, making this technique redundant.

Now, it’s over to you – have you used encoded images successfully in your campaigns? Why? Examples and lively discussion are welcomed in the comments below.

1 By the way, ‘The Outlooks’ is my future indie-band name, hands off yuppies.

  • Robin

    But how can i embed an image. Is there any service or any tutorial on how to do that.
    Eagerly waiting for the reply.

  • Ros Hodgekiss

    Hi Robin, you’ll find a how-to on embedding images in email in our previous post on the topic.

  • lmeurs

    Great test, but what about MIME Multipart/Related content? Your most recent test dates from 2008, my experiences since then are great!

    I understand mailings should not be too bulky, so we would appreciate the possibility to at least embed some light default template images like a logo, header and footer image by ie. adding an ’embed’ attribute to an image tag.

    Later (sadly caught by our filter):

    I understand that your customers have over a million feature requests and you can only honor a few of them, so do not read this post as a complaint or whatsoever.

    Having that said, I thought it wouldn’t be hard for an e-mail delivery company like yourself to replace image URL’s for content id’s and add the actual image as MIME parts. I thought you did not support this technique deliberately, to prevent exorbitant bandwidth usage.

    In the past we worked on some Perl scripts to embed images, but nowadays ie. PHPMailer (search https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/UsefulTutorial for ‘AddEmbeddedImage’) and the Drupal Mime Mail module (http://drupal.org/project/mime… offer the same functionality (almost) out of the box.

    I do not understand why you state “Editing MIME content is out of reach to pretty much everyone” since this is a thing that should be handled by the a server side script, not by your end users.

    I assume bandwidth consumption is one of your concerns for your own as well as the subscribers’ sakes. To optionally only embed marked images (HTML image tags with an ’embed’ attribute) would be a great improvement. And maybe by limiting the total size of an e-mail to ie. 50KB and charge extra credits for over usage you can make customers aware of what they are doing and prevent bulky e-mails.

    Thanks for the effort!

    PS: Is there a way to receive an e-mail alert when a new message in a forum thread is posted?

  • Ros Hodgekiss

    Hi lmeurs, for the sake of practicality, we decided to only cover an embedding method that could be tried and tested by the majority of senders. Editing MIME content is out of reach to pretty much everyone (unless you’ve written your own mail script), so whether or not it works better is moot.

    That said, we’d love for you to share your methodology and results here – that would be awesome!

    Happy to add your vote to make it possible to embed images, however admittedly it may be a little hard to justify, given the poor showing above.


    Update: Sorry, we should try and get email notifications happening.

  • Tom

    Had been using this while developing a client’s signature – as I thought support was better, but then came across this article.

    However, there is a problem with your results… I’ve just tested this with OL 2010 and gmail – both of which loaded/displayed the image immediately.

    The test email was sent from an email address whose images would normally have to be loaded manually.

  • Tjarko

    I see no problems with Outlook, Gmail, Kerio, Thunderbird using inline cid:embedding of images…??

  • Thomas Bachem

    The “cid” method works in ALL major email clients these days!

    I just tested it on all available clients (desktop, mobile, web) over at Litmus.com:

    Apple Mail 5: YES
    Apple Mail 6: YES
    Lotus Notes 6.5: NO
    Lotus Notes 7: NO
    Lotus Notes 8: YES
    Lotus Notes 8.5: YES
    Outlook 2000: YES
    Outlook 2002/XP: YES
    Outlook 2003: YES
    Outlook 2007: YES
    Outlook 2010: YES
    Outlook 2011: YES
    Outlook 2013: YES
    Thunderbird 3.0: YES
    Thunderbird latest: YES
    Android 2.3: NO
    Android 4.0: YES
    Gmail App (Android): YES
    Gmail (Android): YES
    Outlook.com (Android): YES
    BlackBerry 4 OS: YES
    BlackBerry 5 OS: YES
    iPhone 5s: YES
    iPad: YES
    iPad (Retina): YES
    iPad Mini: YES
    iPhone 4s: YES
    iPhone 5: YES
    Symbian: YES
    Windows Phone 7.5: YES
    AOL Mail (Explorer): YES
    AOL Mail (Chrome): YES
    Gmail (Explorer): YES
    Gmail (Chrome): YES
    Outlook.com (Explorer): YES
    Outlook.com (Firefox): YES
    Outlook.com (Chrome): YES
    Yahoo! Mail (Explorer): YES
    Yahoo! Mail (Firefox): YES
    Yahoo! Mail (Chrome): YES

  • Ros Hodgekiss

    Wow, this is brilliant – thank you for sharing your results, Thomas! Do you have a share link to the Litmus test that you can add to this thread? We’ll certainly look into this on our end, too.

    Keen to see if more folks take to embedding images in the future :)

  • Shane

    Haha, ‘The Outlooks’, an instant hit! Thanks for the info, and the laugh :)

  • simon

    has the behavior of GMail changed with their new image policy?

    I would expect it’s more likely they’d show up now right?


  • Ros Hodgekiss

    Hi simon, you’re right – images now show up by default. We’ve got a few observations on this change and its impact on reports in our blog.

  • Php Exp

    I recommend http://base64image.org web tool to encode image to Base64 and back to Image. It supports drag and drop, multiple files and automatic CSS,HTML generation.

  • Olivier Jacquet

    Something that is missing from your test is the size of the image you’re encoding. I can imaging having different results because embedding small base64 encoded images actually shows up in Gmail.

  • Ros Hodgekiss

    Hi there Oliver, please note that all images now show up by default in Gmail, encoded or no. To our knowledge, image size generally doesn’t have an impact on display in other email clients – however large embedded images may increase the likelihood of a higher spam score, or may be annoying to download on slow/cellular connections.

  • Terry Riegel

    Embeded cid: images work in all html clients I tested except LotusNotes 6.6 and 7.

  • firtzmg

    I have heard some people say, that some companies are going back to externally linked images in their newsletters, because many or all mobile and desktop e-mail clients are now blocking CID embedded images by default, while they allow external resources by default…

    I can’t believe that this is actually true, at the most I would expect the external resources to be blocked by default too.

    Could you make such a test on CID embedded images? Or do you have some insights already?

  • Ros Hodgekiss

    Hi there firtzmg, Sendgrid did some testing in May and indeed, found that CID embedded images are blocked in Outlook and many webmail clients. Personally, I’d steer away from using them, given that large email payloads can result in truncated messages. That said, keen to hear your experiences, if you’ve been sending emails with embedded images lately!

  • momo

    why an html mail using base64 works when it’s send by thunderbird but not with campaign monitor?
    why gmail can perfectly read the base64 file when it was send by thunderbird but not by campaign monitor?
    I manage to make it work with inserting html code in thunderbird but when i use campaign monitor it simply cut my base64 code!
    thanks for the reply

  • Ros Hodgekiss

    Hi there momo, if your image embedding requires that you edit the email header, there may be issues. However, your best bet is to send your HTML email and any other details to our team at support@campaignmonitor.com – we’ll happily take a look and make recommendations.

  • Wallace Turner

    That sendgrid article from May 2014 posted by Ros above) is not accurate. It states that CID embedded images do not work in web clients. Thats not true a quick test of gmail and outlook.com revealed they do show. He also stated one of the ‘Cons’ of CID as ‘Feels outdated’ <– your feelings are not a Con.

  • Ros Hodgekiss

    Thanks, Wallace – we’d love to get some more recent research happening, so thank you so much for the motivation! Appreciate you sharing your observations here. Note that both Outlook.com and Gmail have experienced a few changes in the last year, so it’s absolutely possible that their rendering capabilities have shifted since SendGrid’s study was published.

  • Annoyed


    Who gave you the authority to define what a ‘Con’ is?

    A con is simply an argument against a particular decision. It can be a feeling, an opinion, a technical reason, anything.

    By your logic, if I was trying to decide whether to marry someone or not ‘I don’t love them’ would not be a valid item for the ‘Con’ category.

  • DR

    Is it just me or do emails that have embedded images feel a little “slimy”? I say this because I block email images in my mail apps and on my iphone for a couple of reasons.

    1 – Because images turned on allows for tracking. Sometimes I don’t want the company to know if I looked at their email.

    2 – On my phone because if I’m not interested in the email and don’t need to see it I have images off. If I want to see the images I load them. This saves me a little data usage and for the same reasons as #1 – I don’t want to be tracked so much.

    Maybe embedded images can’t have tracking code in them? If they do it would seem like I now have no choice but to download large images I don’t care about and have my email open tracked and there’s nothing I can do about it. Slimy.

  • Kind of Annoyed :)

    @Annoyed: What email technology to use is a different kind of decision than who to marry. In the first case, a technical decision, feelings can only get in the way of the right decision, while in the second case, feelings are the most relevant factor and must be given primacy.

    @DR: Embedded images can NOT be tracked. Linked images can be tracked, because to retrieve them you have to make a request to the server where it’s hosted. You do make a good point about data usage though. Some email clients only download attachments on request, perhaps something similar could be done here – may require changes to email clients.

  • Holly Marotta

    Thank you for sharing your experience & saving me the trouble. Very helpful. On the other hand, I’d advise you to find another band name. We all know ‘The Outlooks’ suck! ;)

This blog provides general information and discussion about email marketing and related subjects. The content provided in this blog ("Content”), should not be construed as and is not intended to constitute financial, legal or tax advice. You should seek the advice of professionals prior to acting upon any information contained in the Content. All Content is provided strictly “as is” and we make no warranty or representation of any kind regarding the Content.
Straight to your inbox

Get the best email and digital marketing content delivered.

Join 250,000 in-the-know marketers and get the latest marketing tips, tactics, and news right in your inbox.


See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free