How to add base64 encoded images in email signatures with HTML?

Spread the love

Sometimes, we want to add base64 encoded images in email signatures with HTML.

In this article, we’ll look at how to add base64 encoded images in email signatures with HTML.

How to add base64 encoded images in email signatures with HTML?

To add base64 encoded images in email signatures with HTML, we set the src prop to the base64 URL.

For instance, we write

<img
  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg=="
  alt="Red dot"
/>

to set the src attribute of the img element to the base64 image URL.

Conclusion

To add base64 encoded images in email signatures with HTML, we set the src prop to the base64 URL.

Leave a Reply

Your email address will not be published. Required fields are marked *