Hacker News new | ask | show | jobs
by alentred 1035 days ago
While we are at it, what is the most surefire way to include images into email? How do I make sure that simple images, like logos, are shown in most common email clients?
2 comments

You don't. Common email clients block images by default, because advertisers used them for tracking.

Or you make ASCII art of the logo.

Or you include a base64-encoded version of the image. Doing it in-line in HTML should work; I believe <img> tags can also reference an email attachment containing the image (email attachments are base64-encoded anyway...).
base64 encoded <img src"<base64>">...

It's the only way to ensure you're logo is forwarded to every single CC and BCC.

edit I take it all back, gmail strips them. I guess as an attachement and then referenced like <img src="cid:<id>">

Gmail does not support base64 images according to caniemail

https://www.caniemail.com/features/image-base64/

The most reliable method is to attach a png image to the email and reference it from the body using `<img src="cid:insert_cid_ref_here" `