Doctype for html email - html-email

Which DOCTYPE is the right one for HTML email?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There is only minor differences these days in DOCTYPE declarations in html email. Although only minor, it is still recommended to test your emails via Email on Acid or Litmus or any other testing software prior to a send to ensure cross client compatibility and to find any unforeseen quirks.
The larger issues comes with if you do not declare a doctype or body tag, it can really screw up different parts of the email on certain clients.
The most popular DOCTYPE nowadays is the HTML 5 doctype (<!DOCTYPE HTML>) which is used with very little hiccups. The most popular/safest doctype used to be the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> doctype. This can still be used, but may limit different capabilities of your email, as it is referencing an older version of HTML.
See this forum post in litmus for more in-depth information on this: https://litmus.com/community/discussions/39-explanation-of-doctype-html-attributes-and-meta-tags-in-email-head

This is what I use.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
I code emails daily and this came as the header that exact target (salesforce) provided us. Our company has sister brands and this what they all use as well so I'm assuming this is standard.

More primitive email readers cannot handle DOCTYPE at all, and instead either strip it completely out of the email, or just remove the string "!DOCTYPE" and leave the rest of the HTML intact. You wind up seeing weird things like this at the beginning of the emails:
< HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...because the word !DOCTYPE was removed, but not the rest, and since it did not remove the space, it displayed the broken code to the reader.
The rest of the email will usually display just fine.
While this obviously is a programming error by the writer of the script, I have seen a lot of scripts with this same exact error. It's usually because they are simply stripping out HTML tags and not allowing !DOCTYPE.
Email clients seem to be able to process your email without it unless you are using a different character set than the user, and sometimes stumble when you declare it.

Related

Can you use https in HTML doctype declarations?

I am wondering if you can use https in HTML doctype declarations? For example, w3.org lists different declarations, all of which have http and not https
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
I have not seen a doctype declaration with https (although, the sample size is small for me). Is there any reason why this remains as http? I am assuming the URI gets mapped to https anyways so it's just a cosmetic thing, but why is this still http?
I'd recommend you use HTML5's <!DOCTYPE html> (listed at the w3.org page you linked), but the older declarations are historical curiosities that don't present a security problem. Browsers don't use that http://... string that appears in the DOCTYPE tag as a URL to load; it's just a way to declare what standard the author intended to follow.

Exact Target Email Template without pre-formatted code

Does anybody know if it's possible to create an exacttarget email template - ET Template NOT a regular htmlPaste email - without any pre-embeded code?
The problem I'm having is ET automatically puts in head and body tags and wraps everything in a 600px wide table.
The 600px wide container overrides my code to make the email responsive for iphones.
Thanks.
Ahh, you must be trying to test a responsive template and email.
Here are a couple of work-arounds:
ExactTarget Support can disable the default headers and footers with a special business rule.
Create a Delivery Profile that includes blank header and footers (either none or blank content areas) and send your tests using a a Guided Send with the Delivery Profile
i beleive you can create a support ticket to update the Default Header & Footer in the Exact target Application.
Responsive Header block should contain:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
Responsive Footer block should contain:
</html>
This will do the trick.
Hope it helps:)

Facebook meta tags issue - debugger says not in the <head> tags

I have an issue with facebook, longer period of time the meta tags are not working on my website. The title is showing perfectly on facebook, however the image doesn't. Also, when I go through fb debugger, it says: Your page has meta tags in the body instead of the head. This may be because your HTML was malformed and they fell lower in the parse tree.
Please fix this in order for the tags to be usable.
My website is: http://www.popularno.mk/, but this error message also comes up at every single post (example: http://www.popularno.mk/2013/07/27/vozila-grcija/)
I'd be very grateful for a solution.
Regards,
There is a Byte-Order Mark that seems to be messing things up for the debugger.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><body>
<p>
You may want to deal with removing that from your code before proceeding further.

HTML Emails appear blank in Yahoo

Im trying to install a good newsletter script for some basic email marketing. The thing is that my yahoo just dont want to display HTML emails. I sent some html test emails to myself through several scripts and from my yahoo account aswell,but all appear blank.
It's quite odd because my magento's html emails are being received correctly,but others [ and even YAHOO emails! ] arent.
Does anyone know why is this happening?
Changed the content type and encoding in the settings for each of the velocity templates to HTML / UTF-8
Added a to each of the emails with the standard charset="UTF-8" declaration. Maybe Yahoo doesn't strip out the head like most other email clients.
Added the HTML 4.01 strict declaration to the top of the email:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
I just ran into this problem myself.
Here is what I found:
Older article, but still useful:
they recommend:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
Which seems to work for everyone except Yahoo.
Instead, use the following for Yahoo:
<!doctype html>

Does anyone have a validation schema for Visual Studio 2010 for XHTML+RDFa?

Visual Studio validates XHTML 1.0 Transitional by default. There are custom solutions for validating HTML5. But if you are writing a site that uses any part of the Facebook API or the meta property tags then your HTML is probably invalid. Most people don't know to change their DOCTYPE to this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
What I'd like to know is, does anyone have a way to get Visual Studio 2010 to recognize RDFa like someone hacked it for HTML5?
I do not know if this contains what you need but you could give it a spin...
There is an update/addon for html5 webstandards
http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
http://vishaljoshi.blogspot.com/2011/06/announcing-html5-css3-support-for.html