HTML电子邮件中的预读文本

时间:2017-08-22 01:51:38

标签: outlook html-email

我在我的HTML模板中添加了预读文本,但它工作正常,但当有人从outlook转发简报时,文本显示在顶部。但它在Gmail中并不会发生。

<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>

谢谢!

当有人转发简报时,它的外观截图

enter image description here

3 个答案:

答案 0 :(得分:4)

为了在各种环境中获得最佳效果,最好不要内联CSS。我一直用这个作为预表者。

var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var express = require('express');
require('remedial');

var app = express();
app.use(cookieParser());
app.use(express.static('temp'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
  extended: true
}));
const port = 443;

答案 1 :(得分:0)

我认为MailChimp确实为这个愚蠢的问题投入了很多精力。他们使用:

<!--[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]-->

答案 2 :(得分:0)

我尝试了以前的答案,但在转发过程中,电子邮件仍然显示很小的文本。我最终使文本与背景颜色相同,而这最终对我有用。

相关问题