You have an e-mail template that has HTML code that is contained in a template field in Microsoft Dynamics CRM 4.0. Then, you create an e-mail message that uses the e-mail template. However, the HTML code that is contained in the template field is displayed unexpectedly as plain text. You expect the formatted HTML code instead of the plain text of the HTML code to be displayed.
This problem occurs because the e-mail template tries to make the HTML code safe when the e-mail template detects any HTML formatting. This behavior prevents rogue HTML code or scripting code from being run in the CRM e-mail form.
This problem is fixed in the latest cumulative update rollup for Microsoft Dynamics CRM 4.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
949256 Microsoft Dynamics CRM 4.0 updates and hotfixes
After you install the latest update rollup for Microsoft Dynamics CRM 4.0, you have to add the EmailTemplateBodyHTMLNoEncode registry key. To do this, follow these steps: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
Click Start, click Run, type regedit, and then press ENTER.
In Registry Editor, locate the following subkey:
Right-click MSCRM, point to New, click DWORD Value, and then type EmailTemplateBodyHTMLNoEncode.
Double-click EmailTemplateBodyHTMLNoEncode, and then type 1 in the Value data field.
Note When the EmailTemplateBodyHTMLNoEncode registry entry is set to 1, Microsoft Dynamics CRM decodes the HTML code in the template body, and then the formatted HTML code is displayed. However, if the EmailTemplateBodyHTMLNoEncode registry entry is configured to be 0, or there is no EmailTemplateBodyHTMLNoEncode registry entry, the e-mail template body is not encoded. Therefore, the HTML code is unexpectedly displayed as plain text.