I have an visualforce email template. I want to add an image to the template i.e. the image will be visible in email sent to an user

<apex:image id="Logo" value="https://......" height="64" width="64"/>

This image is hosted in documents standard objects The image is appearing broken in outlook. Can anyone tell me what is wrong with my code?

3 Answers 3


Open the documents. Open any document (image), right click and copy the image address/url.

Now, create the image tag:


<img src="https://asec.cs1.content.force.com/servlet/servlet.ImageServer?id=0154B0000000XBh&oid=00D4B090000227f&lastMod=1463039579000" alt="Sample Image" height="150" width="850"/>

Using VF:

<apex:image value="https://asec.cs1.content.force.com/servlet/servlet.ImageServer?id=0154B0000000XBh&oid=00D4B090000227f&lastMod=1463039579000" alt="Sample Image" height="150" width="850"/>

You can set the inline height & width properties. Hope that helps.


You should make the document (your image) "Externally Available":

make sure the document is marked as Externally Available on the Documents tab so that a user who does not have a Salesforce username and password can view the image when it is received in an email.

enter image description here


Upload image in documents in salesforce tab with checkbox - Externally Available Image selected. Once the document is save do-

  1. open the image.
  2. Copy the Image location.
  3. paste its value in .

Now try sending mail.

  • I tried that as well. the image is still appearing broken in outlook. The preview displays the image, but it is not present once the mail is sent and viewed from outlook. @Rachit
    – Rimii
    Mar 18, 2016 at 11:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .