Published: April 27, 2020

Coding for Outlook

Accounting for the toughest email client isn't fun but, it must be done.


Should you code for Outlook?

While we hope that our users won't use the client anymore, it still accounts for a fair percentage of the market share. According to Litmus, Outlook and Outlook.com account for about 11.4% of all users. I recommend viewing analytics using your ESP or a service like Litmus to see what your subscribers are using.

At my current workplace in the fashion retail industry, we found that Outlook and its variants only accounted for about 1% of our subscribers—leaving us with the option to not sweat over how our email appears in Outlook. A B2B company might find a different scenario as most of their subscribers may open at work where Outlook is commonly used as an enterprise solution.


Getting started with the basics

Outlook Conditional Statements

We use Outlook conditionals to target and provide special code for Outlook.

Start an Outlook conditional:
<!--[if mso]>

End an Outlook conditional:
<![endif]-->

Anything between these tags will only be executed in Outlook clients. In the example below, Outlook users would have a table rendered along with a paragraph tag stating "You can only see this message in Outlook."


<!--[if mso]>
    <table>
		<tr>
            <p>You can only see this message in Outlook</p>
		</tr>
    </table>
<![endif]-->
            

Targeting versions

Target versions greater than or equal to X version:
<!--[if gte mso X]>

Target versions greater than X version:
<!--[if gt mso X]>

Target versions less than or equal to X version:
<!--[if lte mso X]>

Target versions less than X version:
<!--[if lt mso X]>

Version numbers

mso 9 = Outlook 2000

mso 10 = Outlook XP/2002

mso 11 = Outlook 2003

mso 12 = Outlook 2007

mso 14 = Outlook 2010

mso 15 = Outlook 2013

mso 16 = Outlook 2016, Outlook 2019, Office 365


Supported CSS

Campaign Monitor has a pretty lengthy breakdown of CSS support—you can view the whole list here.

To help you out, I put together this list of the essentials.

SUPPORTED:*

  • background-color
  • border
  • font-family
  • font-style
  • letter-spacing
  • line-height
  • text-align
  • margin
  • padding
  • width
  • <style> tags in <head>

*Note, many of these are buggy and can vary by version of Outlook.

NOT SUPPORTED:

  • <link> tags in <head>
  • <link> tags in <body>
  • * selector
  • :hover
  • @media
  • @font-face
  • text-overflow
  • text-shadow
  • background
  • background-image
  • background-repeat
  • background-size
  • background-position
  • rbga(x,x,x,x)
  • border-radius
  • box-sizing
  • top and bottom
  • left and right
  • z-index
  • float
  • animation
  • ALL transform properties
  • ALL transition properties
  • ALL Flexbox properties
  • ALL CSS Grid properties

Written by Jesse Allen Cooke

Twitter Instagram LinkedIn Dribbble

X:

Y: