I'm wrestling with an HTML email design destined primarily for Outlook/Office 365. Following advice on various sites I'm wrapping my content table in conditional comments in order to give it a fixed width (no max-width support in Outlook). However, content inside those conditional comments is also showing up in Apple Mail (desktop and mobile versions). Can anyone tell me why?
Here's the conditional code I'm using:
<!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td align="center" valign="top" width="600">This should ONLY show up in Outlook
<![endif]-->
<table bgcolor="#bbbbbb" align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:700px; border:1px solid blue">
<tr>
<td>
CONTENT FOR ALL EMAIL CLIENTS
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
That text "This should ONLY show up in Outlook" is displaying in Mail. And I can see the red border of the surrounding (conditional) table in Mail as well. Why is this conditional failing to limit the scope of that code to Outlook?
gwally's comment pointed me toward the answer. Since his testing didn't give him the same results I was getting, it suggested that something about my process was the problem. It wasn't the code, though; it was the fact that I was sending the email out via Outlook. If I sent the same code via Mailchimp it arrives exactly as expected.
I knew about Outlook's horrible (non-)support for pretty-much anything useful when it comes to HTML emails. However, I'd assumed that this applied when it received emails and that it would pass outgoing code along as-attached, and only interpret/murder it when it was received as an incoming mail. What I hadn't accounted for (or expected, though perhaps I should have if I'd thought it through in detail) was that Outlook apparently forces the same horrible rules onto the outgoing code, meaning that every other client basically suffered from the same crippling limitations as Outlook -- including seeing content that should have been Outlook-only. The code I had created wasn't bad, it's just that it was getting borked before it even got out the door. (That's a very simplistic description of the situation, I realise, and I'm sure there's a lot more nuance to precisely how Outlook parses outgoing HTML, but the result ends up being the same for me).
Since our organisation is almost entirely Outlook-based and these emails are designed as reusable templates for internal announcements (to be sent out via that client), I guess I'm just going to have to suck it up. But it's undeniably vexing.
Anyway, at least I now have a clearer understanding of where the goalposts lie.