[SalesForce] Can you embed (not link) an image in an email template

Is there any way to actually embed (not link to) an image in an email template in salesforce? What I have in mind would create an email with a 'Content-Type: text/html; charset="us-ascii"' in which it would refer to images like this:

<img src="cid:image001.png@01CD11BA.4FD2D9A0" ….

so that the images are in the email, not gotten from a webserver.

I haven't seen any way to do this, everything refers to hosting them at salesforce in the documents (I would do that on my own webserver instead then).

Best Answer

You could base64 encode the image and use it as the source. This takes advantage of the Data URI scheme.

Example from the wikipedia page:

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

You can find various free tools online that will convert your image to Base64, but keep in mind this has various drawbacks:

  1. No caching of image files (a problem for repeat viewing)
  2. Your email will be larger
  3. Your images will be larger due to the data scheme
  4. You have decentralized the image so you will not be able to update it in case of an error
Related Topic