1

I guess this is a standards question and not a specific coding question.

I wanted to know if I needed to validate the HTML with something like W3C HTML Validation? If I send the DOCTYPE and META tags in the HTML email it doesn't render the HTML in the email properly but validates with W3C, but if I remove the DOCTYPE and META tags the HTML renders properly in the email client but now doesn't validate with W3C. Is this something that I should be concerned with or is this standard practice?

In PHP I'm doing Example #4 if you need to see how to send a HTML email in PHP

Phill Pafford
  • 83,471
  • 91
  • 263
  • 383

2 Answers2

3

There is nothing standard in HTML e-mail at this time. While it is good to target towards valid HTML, you'll find there are lots of modifications you will need to make for your e-mail to work.

Target the client, not the specification, in this instance.

Perhaps some day valid HTML e-mail will be a reality, but it isn't for now.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • I haven't found much need to validate HTML to begin with... at the end of the day Google can get what it needs, that's all that matters. – Ben Jan 17 '11 at 19:30
-1

For HTML emails, currently it's best to use tables for any kind of layout you might want to do. Mailchimp has a few templates that can get you started for some basic email layouts.

MailChimp Email Templates

John
  • 477
  • 1
  • 7
  • 16
  • 1
    Sorry not really asking how to code a HTML email, but is there any validation needed or is it the 'Whatever works' approach? – Phill Pafford Jan 17 '11 at 20:12
  • It's the "whatever works" approach. Sometimes though, you may want to link to a browser friendly version of the email and that is when you'll obviously want it to validate. – John Jan 17 '11 at 20:16