BLOG

HTML in email

Steve and I were talking this afternoon about HTML in email. He wanted to know what headers I looked for in the HTML portion of an email. A good question, as I’ve seen everything from a full doctype declaration through to just <body> tags.. All of them seem to render OK in various mail clients so I don’t spend too much time worrying about the specific HTML header elements. I do look for invalid tags and comments, but I check those whether they are in the header or the body.
Those of you that design HTML emails, what are your experiences with headers? Are there specific HTML headers that you always include? Do you skip the header portion of the HTML document and just use body tags? How do you test? What do you think is important?

3 comments

  1. Greg Strutton says

    In my view, write valid HTML as per W3C. Even if some email clients may ignore or strip out elements, creating invalid HTML is just a bit lazy. I think it’s always important to be standards compliant. As there isn’t an email based HTML mark up specification, stick with the current HTML spec.
    I must adimt that I haven’t tested the difference between using full markup and just the body tags, but don’t some filters mark content down if the HTML is invalid or contains errors? That was my understanding.
    Hope those thoughts are useful.

  2. laura says

    Valid HTML per W3C includes both header and body tags, as well as DOCTYPE declarations. Clearly these aren’t required in email. It seems that W3C validating HTML is not require for email.
    Making up tags is a problem and comments are a problem. But tags don’t seem to be required, even though that’s clearly invalid.

  3. Jared Kimball says

    Designing email is different because email service providers set the rules when it comes to allowing or not allowing HTML code. From my experience I’ve found that declaring the DOCTYPE has been irrelevant to the content and displaying of the message. For example Yahoo will display the content regardless of the declaration and will allow specific content and so will Gmail. In a nutshell they control what is displayed to the recipient, so they choose to allow some HTML and not allow specific tags, but there isn’t a standard for email.
    I think if they honored the declaration and standards of HTML then email would work like a web page. Instead they choose to dictate what HTML tags will display and which ones won’t. When I create emails I focus on the body tags and will ignore most of the Header tags. It seems to make little difference either way.
    Hope that helps,
    Jared

Comment:

Your email address will not be published. Required fields are marked *

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