Find your content:

Search form

You are here

Is is possible to display an image or icon in a Email using a Visualforce template?


I am trying to send an email using a Visualforce template and I want that template to include an icon. Is this possible?

Attribution to: dublintech

Possible Suggestion/Solution #1

Sure, <apex:image> tag or plain old <img>.

  1. It cannot be an image from static resources though.
  2. If you want to use image hosted in your salesforce, best would be to upload it to Documents and tick the "externally available image". And then remember to use full path: https://{instance id}{document id}&oid={your org ig}

Attribution to: eyescream

Possible Suggestion/Solution #2

<apex:repeat value="{!relatedTo.NotesAndAttachments}" var="c" rows="1"> 
    <div align="left"><apex:image url="/servlet/servlet.FileDownload?file={!c.Id}" height="100px"
        width="200px" /></div>

If its in Notes and attachment the above code is handy and i have used and its working.

If stored in documents ImageServer?id=BBB&oid=CCC

AAA = your SFDC server, found in the URL of any SFDC link after you log in

BBB = the record ID of your publicly available document

CCC = your organization ID

You can pull from documents.Dont pull from static Resource .It never works .

Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content