Outlook Conditional Statements

It’s not a big surprise when we need to write some specific CSS for our html email templates, in order to target Microsoft’s offline email client, our beloved Outlook.

We can do that by using a simple <if> statement in the <head> of our document, known as a conditional statement:

<!--[if mso]>
 // Only for Outlook (all versions)
<![endif]-->

We can take it even further from there and target specific versions of Outlook.

Specific Outlook Conditional Statements

First of all, take a note / screenshot of the numbers below, they are the versions of Outlook.

  • Outlook 2000 – Version 9
  • Outlook 2002 – Version 10
  • Outlook 2003 – Version 11
  • Outlook 2007 – Version 12
  • Outlook 2010 – Version 14
  • Outlook 2013 – Version 15

If we want to target Outlook 2007 and later

<!--[if gte mso 12]>
 // Outlook 2007 and later
<![endif]-->

If we want to target only Outlook 2010

<!--[if mso 14]>
 // Only Outlook 2010
<![endif]-->

Happy targeting!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.