47

To avoid unloaded images, for my inline html-mail I've encoded all images (4 actual images and 6 empty gif for spacing) to base64 strings,. Works pretty fine how-ever gmail refuses to decode these back into images. I've done some pretty extensive investigation but came up empty handed.

What about cid:url?

j08691
  • 204,283
  • 31
  • 260
  • 272
no0ne
  • 2,659
  • 8
  • 28
  • 44

2 Answers2

32

Gmail Web Client does support embedded images

See my answer to Base64 images to gmail

Community
  • 1
  • 1
cusman
  • 1,711
  • 1
  • 17
  • 17
  • If you using nodemailer, check the solution [here](https://stackoverflow.com/questions/41946783/gmail-blocking-small-embedded-inline-images-in-email-template/68532260#68532260) – Marvin Correia Jul 26 '21 at 15:09
15

Gmail doesn't anymore.

Apple mail is one of the few that still does. So unless you plan on sending only to apple owners, you may want to find another way to do that

For example, adding another part with your base64 image: Content-Type: image/png; name="imagename.png" Content-Disposition: inline; filename="imagename.png" Content-Transfer-Encoding: base64

Jeremy
  • 942
  • 1
  • 10
  • 28
  • It still works on my Gmail accounts the classic way: . Both desktop and mobile apps. – Kristián Filo Jan 21 '19 at 11:46
  • @Jeremy, do you know how recent exactly is this? I just recently got complaints about this from clients, and I didn't do any code change in the mailing subsystem since last summer. I cannot decide if this is something on my end. Outlook web mail client also doesn't display the base64 inlined image. – Csaba Toth Feb 11 '19 at 19:34
  • 6
    I tested it. "data:image/png;base64" just doesn't work for GMail anymore. You need to use cid and inline attachments instead – Jeremy Feb 25 '19 at 12:01
  • 4
    Can you show us how to use cid and inline attachment, perhaps in a new answer? Thanks – Houman Mar 01 '20 at 21:06