2
Using Comments in Email Code
Hi guys, I'm sure I've heard before that it's important to remove any comments from your email code before sending it out. I use <!---- comments ---> regularly but have never seen any issues? Is anybody aware of any problems these cause?
Thanks
Luke
I recently found out that the mobile version of the french webmail of Orange has a few quirks with HTML comments. Basically,
<!-- A comment -->
will be converted to<!--- - A comment - --->
. This isn't a problem for regular comments. However, this will completely mess up your code if you use conditional comments for Outlook. I wrote about it in depth here (in french).A while ago, I also read about a bug in Outlook.com that will render an email blank if a CSS comment contains an HTML tag (for example
/* I like <div>s */
).The only client I've seen that is affected by comments is Yahoo! Mail. But only CSS comments.
http://freshinbox.com/blog/yahoo-mail-removes-css-under-comments/
Conditional HTML comments are used fairly liberally in email to deal with Outlook quirks so I'm assuming regular comments would be ok as well.
I haven't seen any issues. I use both CSS and HTML comments regulatory in my code. I don't inline or package my code before it's deployed. I use Campaign Monitor.
afaik Campaign Monitor strips out HTML comments but not CSS ones.
we use both comments quite a bit, never really seen any issues but I'm sure they happen somewhere. It used to be a no-no for Hotmail in 2006 but they seem to have got over it.
Unless the comments have sensitive information or profanity "F*$%ing Outlook.com!", I don't see any issue with comments.
Great news. Thanks everyone!
Beside the possible issues you could encounter with a few mail clients, the only reason I see for removing comments is that it will reduce the size of the email which can slightly reduce loading time as well as the chances for your email to fall into the SPAM folder (according to posts like these: 1 or 2).