Reputation: 11
I have a requirement where in I have to to send an email to customer, I have an email template coming in from database (blob data). And there is an header image which should be displayed in the email when customer opens the email.
This image is a client header. How can I embed the static image without referring to any location or any online website.
Upvotes: 1
Views: 2126
Reputation: 633
in case you don't want to load images from the server then only embeding of image with base64 can workout.
Please refer the link below for more reference.
http://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html
Upvotes: 0
Reputation: 29342
The general solution to this problem is multipart MIME. You add the image as a part of the email message and use a cid reference in the <img>
tag.
However, you're probably using some library to send this email, in which case it probably has an API for creating multipart MIME messages.
Upvotes: 0
Reputation: 17849
Yes this is possible by encoding the image in Base64
For more info see this Displaying images in webpage without src URL
Finally you will end up with something like this in your html message:
<img src="data:image/png;base64,iVBORw0KGgoAA.........very_long_string....." />
Upvotes: 2