2

I have added preheader text in my HTML template and it is working fine but when someone forward the newsletter from outlook, that texts are shown on the top. It doesn't happen in Gmail though.

<style>
.preheader { 
display:none !important; 
visibility:hidden; 
opacity:0; 
color:transparent; height:0; width:0; }
</style>
</head>
<body>
<span class="preheader" style="display: none !important; visibility: hidden; 
opacity: 0; color: transparent; height: 0; width: 0;">
We are offering a six-week Indonesian language course for adult learners.
</span>

Thanks!

Screenshot of how it looks when someone forward a newsletter

enter image description here

KH2301
  • 77
  • 1
  • 6
  • Possible duplicate of [Java: How to unescape HTML character entities in Java?](https://stackoverflow.com/questions/994331/java-how-to-unescape-html-character-entities-in-java) – Syfer Aug 22 '17 at 09:38

3 Answers3

7

For best results across environments, you'll be better off inlining the CSS. I've always used this for preheaders.

<div style="display:none; font-size:1px; color:#e5e5e5; line-height:1px; font-family:Verdana, Helvetica, sans-serif; max-height:0px; max-width:0px; opacity:0; overflow:hidden; mso-hide:all;">
PREHEADER TEXT HERE
</div>
gj-wes
  • 912
  • 5
  • 9
2

I figure MailChimp has surely put a lot of energy into this dumb problem. They use:

<!--[if !gte mso 9]>
<span style="display:none; 
             font-size:0px; 
             line-height:0px; 
             max-height:0px; 
             max-width:0px; 
             opacity:0; 
             overflow:hidden; 
             visibility:hidden; 
             mso-hide:all;">YOUR MESSAGE</span>
<!--<![endif]-->
mlissner
  • 17,359
  • 18
  • 106
  • 169
0

I tried the previous answers but on forward, the email still showed tiny text. I ended up making the text the same color as the background and that's what finally worked for me.

Maggie Rose
  • 1
  • 1
  • 1