1

our project is email campaign. The customer will upload the HTML email template using file upload control to our database. The uploaded HTML email template contains image path. That image path mention local directory of customer and so that image will not be displayed in the mail after sent. Our ideas is... we need to suggest customer to create html design template with appended image binaries. If already html email template contains image binary data, then the image will be displayed without referencing any source path local or online. Is this correct approach? or any other best method to append image with html email template to avoid the loss of local directory images of customer. Please suggest. Your correct answer would be greatly appreciated. Thanks a lot

Mohan J
  • 11
  • 3
  • There are a lot of "how to" on internet, try to search. From my own experience, the binary data are not supported in any mailbrowsers – areim Jul 07 '15 at 13:18
  • 1
    http://stackoverflow.com/questions/2429934/is-it-possible-to-put-binary-image-data-into-html-markup-and-then-get-the-image – RhinoDevel Jul 07 '15 at 13:20

1 Answers1

0

You can use base64 encoding for embedding images in HTML. You can guide your users to use one of available online tools (like this one) for encoding images into base64 string. Its output can be then embedded in HTML file as:

<img src=”data:<MIMETYPE>;base64,<BASE64_ENCODED_IMAGE>”>
  • hi, thanks for your reply. great answer. we send email with appended this image tag with base64 string. But email client does not show that image. Moreover, I tried using div to show image through css style background. Local browser window shows image. but email client does not show that image. please guide me. thanks a lot in advance. – Mohan J Jul 08 '15 at 06:34
  • Not all email clients support embedding base64 encoded images. You can try adding image as an attachment instead, as described [in this SO answer](http://stackoverflow.com/questions/9110091/base64-encoded-images-in-email-signatures/9110164#9110164) – Grzegorz Kapusta Jul 13 '15 at 14:54