0

I am just starting to send HTML emails. I read that I need to include <head> and <body> tags in my HTML emails. Are there other tags, meta tags, or other things that need to be included too?

I'm considering using an HTML5 boilerplate, but I'm not sure that would contain all of the standard web tags required.

1

An HTML email may contain all the the HTML tags. Specially important, even when redundant, is to use <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> (or whichever charset you want to use) to avoid potential problems with charsets on clients that don't read the headers, or do a post interpretation based on what they find on the email. Also specify encoding on the headers if you are programming the email.

About using HTML5, I wouldn't use it unless you are 100% sure about the software your clients are using and their capabilities. Some clients may have an up to date HTML engine but some may not. Plus some people just don't want HTML email and they only get the text version, in this case, parsers usually just discard tags and add some new lines, but there may always be surprises.

Of course, you can test if it works, or you can send both versions, text and HTML, so if one doesn't work properly, the user still has the other option.

  • 1
    "text version ... parsers usually just discard tags..." - Ideally the email should specifically contain a text/plain section (in addition to the text/html) for users not wanting (or able) to view the HTML version. This also reportedly helps to avoid the email being seen as potential spam by some email clients. – MrWhite Mar 21 '14 at 1:54
  • How do I include 2 different version on my email using PHP? – Hoytman Mar 21 '14 at 12:10
  • Hoytman: this is tricky to do with PHP natively, I'd suggest using a third party mail library like SwiftMailer or Zend Mail to help with this. – Tim Fountain Mar 21 '14 at 18:24
  • It's not difficult, just look for how to make a multipart message on PHP, there are lots of forum post and tutorials on Internet. – PatomaS Mar 22 '14 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.