Conditional Comments for HTML Email

Take a look at this:

<!--[if gte mso 9]>  <![endif]-->

Chances are the general syntax will be instantly familiar — it’s a conditional comment, useful for feeding specific content only to Windows versions of Internet Explorer. But did you know they work for Office applications too?

Conditional Comments for HTML Email

Neither did I … until recently.

We’ve just overhauled the HTML templates for our email newsletters … a painful process to be sure — if you think that web browsers are harsh task-masters, you should try coding to suit email clients! A recent article, How to Code HTML Email Newsletters, spells out just how convoluted it can be, and how arcane are the techniques you have to resort to, to produce a decent layout in the most popular email clients. And the issue has been further complicated by the fact that one of the most popular Windows clients — Outlook — no longer uses Internet Explorer for HTML rendering, it uses Word!

And it was while perusing the franken-code that passes for “Save as Web Page” output from a Word document, that I first saw these little nuggets — exactly what we needed to hide bits of content from Outlook that were just too mangled to leave.

So there you go. If you’re publishing HTML email and struggling with Outlook’s rendering, here’s an extra little tool for the kit. The syntax even implies that it can be used for granular targetting of Office versions all the way back; but I haven’t tested this, so any information is gratefully received :)


Category: programming Time: 2008-07-18 Views: 1

Related post

  • A New Standard for HTML Email 2007-09-29

    The following is republished from the Tech Times #174. If you're one of the many lucky readers of the Tech Times who use Outlook 2007-whether by choice or not-then chances are you've noticed this newsletter and many others haven't looked quite right

  • How to Use Conditional Comments for Better CSS 2008-11-13

    I'm a new contributor to the SitePoint blogs and will mostly be covering front-end development and Semantic Web technologies. I'm looking forward to participating in the SitePoint community! Sometimes it's the simplest things that go unnoticed for th

  • Mail - Fonts for HTML emails 2010-10-07

    I recently added a large number of fonts to my system (OS X 10.6), and have run into a strange problem where HTML formatted emails are rendering with an unexpected font. I have put an example below. Until recently this and other HTML emails would ren

  • How to find Source for HTML Email 2009-07-24

    How to find the source of HTML Email on Outlook or Thunderbird ? is there any plug-in for that ? --------------Solutions------------- For each of the following, open the message then: Outlook 2003: Right-click anywhere in the message and select View

  • Does MailChimp host images for HTML emails? 2011-01-12

    If I want to send out HTML emails via MailChimp, would they host images for me or do I have to do it on my own server? --------------Solutions------------- From MailChimp Full Feature List : Free Image and File Hosting Upload images and files into yo

  • 10 Popular Layouts for HTML Email 2011-01-27

    Even at a width of 600 pixels, there are plenty of ways to lay out HTML email content. How do designers usually approach an email layout? The image below shows some the most popular block-level email layouts, as taken from a typical day of email camp

  • Is there a standard format for HTML-emails? 2011-08-25

    I have noticed that HTML-formatted graphical emails which I receive are the perfect width for the message pane in Lion's Mail app. It almost looks as if Apple designed them (it didn't they are from random companies). Is this a coincidence, or is ther

  • What are best practices for (html) email digests? 2011-12-07

    Should Digests Emails (html version) contain a summary with anchor links? I get digest emails from Yahoo Groups and they contain a summary of messages at the top. Clicking the link in a summary takes me to an anchor within the email, so I can skip ri

  • Thunderbird disable remote content warning for HTML email 2012-05-29

    In Thunderbird version 12.01, is there a way to disable the remote content warning that appears in situations such as: when an HTML email wants to load images hosted online? I expected that the Security tab in Preferences would have an two options: D

  • Google Static Map API specifically for HTML Email? 2015-10-29

    Has anybody ever tried using Google Static Map API or something similar to generate dynamic map images to be used within HTML emails? There's over 2k store locations and I'm wanting to avoid manually creating map images for each one. I'm hoping to us

  • Issues align div for html email 2016-01-19

    I've been reviewing some older posts on how to align two divs side by side, however I just can't seem to get this right. I have a HTML email which I would like to send with two buttons 'Accept' and 'Reject' Code I'm been testing is below. <!DOCTYPE h

  • Using wordpress templating for html emails 2014-09-30

    Im working on a plugin that needs to send out an email after a form submission. Im using wp_mail for this, and it works perfectly fine. My problem is that in my code the html is generated by a bunch of php string being added to a variable like so: $c

  • Div over an image for HTML email 2016-01-26

    I have some text to be viewed over an image. I can achieve this using margin or position but since it is an HTML for email, these are not working as I needed. Below is my code for it. <div style="padding-right:25px;padding-left:20px"> <

  • Load images by default for HTML Emails in Evolution 2010-10-05

    It seems that each time I go to open an HTML message in Evolution I have to goto View -> Load Images. Is there a way to change this so Images will be automatically downloaded each time I receive an HTML message? --------------Solutions------------- I

  • My Current HTML Email Development Workflow 2015-09-22

    Each one of us has our own approach to web development: a preferred editor, some helper tools, a personal project flow, and so on. When we deal with big or complex projects, it is essential to have a clear development path, to both save time and mini

  • Searching for ideas for next development of classes for (HTML) code generation [on hold] 2016-02-28

    I have project for generation primarily of HTML code, that is written in PHP (and uploaded on Primarily means that this language is main language that can be generated with classes of this project (and some posibilities of this proj

  • Microsoft Breaks HTML Email Rendering in Outlook 2007 2007-01-10

    The following is republished from the Tech Times #156. If support for web standards in browsers is improving slowly, then support in email clients is moving at a glacial pace. Attempts to document things like CSS support in the major email clients ha

  • News Wire: How to make HTML email rock 2007-09-14

    +1.5 Years: Where Are We Now? The Dojo Toolkit's Alex Russell notes the amount of time that has passed since IE7 was released, and how little has been said by Microsoft about IE.Next. Is Microsoft working on something amazing in secret, or is IE at r

  • Has anyone gotten HTML emails working with Twitter Bootstrap? 2012-03-16

    I'm using the premailer-rails3 gem which pulls styles inline for html emails, and I'm trying to get it working with Twitter bootstrap. It looks like some styles come in correctly, but not all of them. I'm

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 1.817 (s). 13 q(s)