Loading

HTML Email Templates Have Extra Spaces

Date de publication: May 11, 2026
Description

HTML email templates in Salesforce may display extra spaces or unwanted line breaks after being saved. This issue typically occurs when template content is created or pasted from Microsoft Word, or when the template encoding is not set to Unicode (UTF-8). This article explains the most common causes and how to fix each one.

Résolution

Cause 1: Microsoft Word Auto-Formatting

When template content is created in Microsoft Word, Word's auto-formatting feature adds formatting information (such as hidden line breaks and paragraph styles) that Salesforce does not support. This causes extra spaces to appear in the rendered email.
Fix: Turn off the auto-format function in Microsoft Word before copying content into the Salesforce email template editor. Alternatively, undo auto-formatting as it occurs in Word.

Cause 2: Extra Line Breaks from Copied Content

When text is copied from external sources such as a website or document, line breaks from the original content may create extra spaces in the Salesforce template.
Fix:

  1. Copy the text into a blank Notepad file first to strip external formatting.
  2. Then cut and paste the plain text from Notepad into the Salesforce email template editor.
  3. Note: This method may strip desired fonts or formatting. Proof the template after pasting and make formatting adjustments directly in the template editor.

Alternatively, in the Salesforce template editor, backspace over the extra line spaces and press Shift+Enter to remove unwanted line breaks.

Cause 3: Incorrect Template Encoding

Incorrect encoding settings can cause extra spaces to appear, especially when using languages other than English or when the template uses special characters.
Fix:

  1. Click your avatar in the top-right corner of Salesforce.
  2. Go to My Settings > Language & Time Zone.
  3. Change Email Encoding to Unicode (UTF-8).
  4. Save your settings and test the template.

Note: The Language & Time Zone setting in personal settings affects how emails are encoded. Changing to UTF-8 resolves encoding-related spacing issues in most cases.
additional_resources__c (Updated):

  • Email Template Not Displayed Properly in Outlook or Other Email Clients


See Also
Email template not displayed in Outlook or other email clients

Numéro d’article de la base de connaissances

000385058

 
Chargement
Salesforce Help | Article