VG
0
Trouble With Preheader Text in Outlook 2007+
I am adding a preheader to my email and the text is appearing in the always troublesome Outlook 2007 2010 and 2013
This is the code I am using right after the <body> tag:
<span style="display:none !important; visibility:hidden; opacity:0; color:transparent; height:0; width:0;">This is a test</span>
try with this after
<body>
Strange, that should fix it specifically for those versions of outlook.
Maybe try:
Or wrap it in
<!--[if !gte mso 9]><!---->
preheader
<!--<![endif]-->
You need to add 'mso-hide: all'.
I use this:
Tested in Litmus. Works for me.
Note: I wrap the preheader into a <td> instead as <span> seems to increase the Spam Assassin score (https://www.campaignmonitor.com/forums/topic/8131/hidden-preheader-span-scores-20-points-with-spamassassin/)
The only way you can hide something in outlook is to place it in the style tag. If you place something in a style tag, it will only show up on devices that render a style tag.
You have two options.
Code a preheader that is the same color as the background and change the font color based on the device. I'm not really sure why you would do this though. Defeats the point of a preheader.
You can create a mobile preheader for iphone and gmail. Place this code right below the <body> and right above the first <table> tag at the top of your email. This allows you to provide a preheader without actually displaying it in desktop clients.
My version, which handles all cases for Gmail, Yahoo! Mail, and Outlook, is the following:
Excuse the HTML comment formatting. I have no idea how to get around that.
Try adding;
Should fix it for ya.
Just tried that but it didn't work
Its a pretty simple answer, but when I don't want the preheader text to show I just make the font color the same as the background color. That's the only surefire way I've found with those versions of Outlook.
Problem with that is that it adds extra spacing at the top portion of your email.
Also I think this technique (color = background-color) can cost you a few points in Spam Assassin.
You cannot hide text in Outlook.