I want to create an email from a template and insert the contents of an rtf field from a record into the email. To this end, I created a visualforce email template (see attached code) enter image description hereMy problem is that when the rtf contents of the field are inserted into the body of the email the formatting is lost (see here) enter image description hereand it is converted back into text. rather than minting the formatting (see here)enter image description here How can I create an email template that will take the contents of an rtf field from a record and insert it into the bey of the email and maintain its formatting? Once I am able to display the formatting correctly (by using the apex code solution below) I still cannot display the image within the RTF field. enter image description here

1 Answer 1


Try doing this:

<apex:outputtext value="{!thefield}" escape="false" />

This should display the HTML correctly.

  • Brilliant, that enables me to get the formatting, BUT it does not show the image embedded, I have updated the question to include the screenshot. Any ideas how I get around that issue of not being able to display the image inline?
    – Bartley
    Oct 7, 2014 at 21:45
  • @Bartley: Try using Apex:outputField instead.
    – PepeFloyd
    Oct 8, 2014 at 8:51

You must log in to answer this question.

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