Search code examples
htmloutlookhtml-emailemail-clientoutlook.com

HTML Conditional Statement for Outlook.com


I am trying to use two conditional statements in HTML email template. The statements are testing for the MS Outlook client, if true it will render an image, otherwise it will hit the next statement to test if the client is NOT MS Outlook, then render some separate HTML.

<!--[if mso]> ... <!--<![endif]--> <!--[if !mso]><!-- --> ... <!--<![endif]-->

This works great for the majority of Outlook desktop clients, however Outlook 2003, 2011 and 2016 (mac) seem to be ignoring the if mso statement. The other issue that I have here is that Outlook.com doesn't seem to recognise this statement either.

I was wondering if anybody else had come across this issue in the past and if so what was their solution around this? I imagined the if mso statement would pickup any form of Outlook client but my assumption seems to be wrong.

Any help would be appreciated :)

Cheers!


Solution

  • Outlook for Mac (at least the 2016 release) uses Webkit to render content rather than the MS Word engine that most Windows versions of Outlook used. The good news here is that you don't need to jump through as many hoops to get it to render things 'correctly'. The bad news is that that's why [if mso] doesn't work here.

    Outlook.com appears to strip all conditionals, which is why you're not seeing the image there either.

    Probably not the news you are after, but hope it helps.