Skip to the page
html email reference · client quirks

Outlook conditional comments in HTML email

type
doctype + comment syntax
applies to
the whole email document, and any Outlook-only markup within it
screen reader effect
n/a
common values
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...>

Where it goes

The doctype goes at the very top of the file. MSO conditionals wrap any Outlook-specific fallback markup, typically extra table wrappers for layout Outlook otherwise mangles.

Example

<!--[if mso]>
<table role="presentation" width="600" align="center"><tr><td>
<![endif]-->
  <div style="max-width: 600px; margin: 0 auto;">Content</div>
<!--[if mso]>
</td></tr></table>
<![endif]-->

Open this example in the editor →

Common mistakes

  • Using a modern HTML5 doctype (<!DOCTYPE html>) out of habit — Outlook's Word engine handles it far less predictably than the XHTML doctype the ecosystem has standardized on.
  • Writing real content inside an MSO conditional block that other clients also need to see — anything inside <!--[if mso]--> is invisible everywhere except Outlook.

Related

Updated 24 October 2026. Practice it in the html email route, or read more on MDN.