1

I'm trying to include an image in HTML email, I'm sending information by encoding the image to base64 and using the img tag.

The HTML:

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

I can't see the image in my mail, also I found the following article which reflect the issue.

So how can I send the image into the HTML?

Note: I can't use external links since we have some restrictions.

James Snowy
  • 415
  • 1
  • 8
  • 21
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
  • 3
    Possible duplicate of [embedding image in html email](http://stackoverflow.com/questions/6706891/embedding-image-in-html-email) – Kristijan Iliev Dec 14 '15 at 14:00
  • 1
    Are you 100% sure that the email client is not just blocking image? Have you tried multiple clients? And just to be sure that the base64 data is correct, is image showing locally when you open HTML in browser? – Maksim Luzik Dec 14 '15 at 14:04
  • Support for it is sketchy, especially in older clients, and if you're doing HTML emails properly then you want to support as many clients as possible. Why do you have to embed? – Michael Dec 14 '15 at 14:05

1 Answers1

1

Set a cid for example

<img src="cid:myimage" />

and attach the image with a name that is the same as your cid

Andre Lombaard
  • 6,985
  • 13
  • 55
  • 96