When including images from Salesforce Static Resources in a Visualforce email template using ``, the image may not display in the email recipient's client. Instead, a broken image indicator — an 'X' mark — appears in the email.
For example, the following Visualforce markup generates a relative URL that is only accessible to authenticated Salesforce users — not external email recipients:
<apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>
<apex:image url="{!URLFOR(!$Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />
The expression {!$Resource.myResourceImage} generates a relative URL such as /resource/1312483024000/logo. This URL is accessible only within an authenticated Salesforce session.
Static Resource URLs generated by {!$Resource.myResourceImage} are relative URLs, accessible only to authenticated platform users. Even setting the Cache Control field on a Static Resource to "Public" only makes the resource accessible within your Salesforce org — it does not make the image available to external email recipients.
To display images in email sent from Visualforce templates, store the image as a Salesforce Document (not a Static Resource) and check the Externally Available Image checkbox on the Document record.
Once the Document is marked as externally available, reference it in your Visualforce template using the following markup (
Static Resource URLs generated by {!$Resource.myResourceImage} are relative URLs, accessible only to authenticated platform users. Even setting the Cache Control field on a Static Resource to "Public" only makes the resource accessible within your Salesforce org — it does not make the image available to external email recipients.
To display images in email sent from Visualforce templates, store the image as a Salesforce Document (not a Static Resource) and check the Externally Available Image checkbox on the Document record.
Once the Document is marked as externally available, reference it in your Visualforce template using the following markup:
<apex:image id="theImage" value="https://c.<instance>.content.force.com/servlet/servlet.ImageServer?id=<document_id>&oid=<organization_id>" width="200" height="200"/>
000384817

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.