Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to successfully embed images in HTML for display in webmail clients?

I'm trying to do a signature in HTML using images that are encoded in base 64 data URLs. Here's an example:

<img src="data:image/png;base64,iVBORw0KGgoAAAAN...kJggg=="> 

It's working nice with mail software as Mail on Mac or Thunderbird but it's not working with webmail such as gmail, outlook, roundcube , hotmail ...

Have you any idea how to make it work ? I really want to put those images directly in the source code, it's more practical.

like image 935
frénésie Avatar asked Oct 24 '12 12:10

frénésie


People also ask

How do I embed an image in webmail?

Position your cursor where you want the image in your message. In the ribbon, select Insert > Pictures. Browse your computer or online file locations for the picture you want to insert. Select the picture, then select Insert.

How do I embed an image in an HTML email?

To attach an image, you need to have the encoding scheme of the image you want to attach. This is the base64 string of the picture. You can get this by right-clicking on the image you want to attach, copy the image address, and paste it into the HTML text. The recipient will have a preview of when they open the email.

How do you embed an image directly in HTML?

The HTML <img> tag is used to embed an image in a web page. Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image. The <img> tag is empty, it contains attributes only, and does not have a closing tag.

Why are images not showing in HTML email?

In some cases, senders may be able to know whether an individual has opened a message with unique image links. As always, Gmail scans every message for suspicious content and if Gmail considers a sender or message potentially suspicious, images won't be displayed and you'll be asked whether you want to see the images.


1 Answers

simple answer?

You can't. Gmail, outlook etc will ignore base64 images.

Look at this site to learn more about this

enter image description here

So based on our results, it is clearly not worth using embedded images in your emails. All you will be doing is forcing people to download encoded images that they will not be able to view.

like image 159
Mark Avatar answered Sep 22 '22 20:09

Mark