发邮件,outlook2016 收到邮件样式不对"/>
开发发邮件,outlook2016 收到邮件样式不对
1.在邮件开发邮件发送的时候,可能会嵌套html标签,在主流的浏览器好foxmail显示是正确的,但是在outlook工具上显示不正常,刚开始的时候很好奇,为什么不对呢,经过测试 我们写的邮件的html是html5,outlook的兼容html2,意思不需要写那么骚气的html标签。
html5:
<div style="padding:1rem;">
<h4>尊敬的客户,您好!</h4>
<h5>您的电子发票已生成,发票信息如下:</h5>
<div style="margin: 50px auto;">
<ul style="background: #fdefe5; color: #eb5404; display: block; clear: both; width: 90%; overflow: hidden; border: 1px solid #eb5404; padding:0; margin:0; list-style:none;">
<li style="float: left; width: 30%; line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">电子发票代码
</li>
<li style="float: left; width: 30%; border-left: 1px solid #eb5404; border-right: 1px solid #eb5404;line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">电子发票号码
</li>
<li style="float: left; width: 30%; line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">开票日期
</li>
</ul>
<ul style="margin-top: -2px;display: block; clear: both; width: 90%; overflow: hidden; border: 1px solid #eb5404; border-top: 0 !important; padding:0; margin:0; list-style:none;">
<li style="float: left; width: 30%;font-size: 80%; line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">{{1}}</li>
<li style="float: left;width: 30%;font-size: 80%; border-left: 1px solid #eb5404; border-right: 1px solid #eb5404; line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">{{2}}</li>
<li style="float: left; width: 30%; font-size: 80%; line-height: 35px; box-sizing: border-box; text-align: center; padding:0; margin:0; list-style:none;">{{3}}</li>
</ul>
</div>
<h6>您可点击<a href="{{4}}" style="color:#eb5404; text-decoration: none;">进行发票查看、下载</a></h6>
<div style="margin-top: 50px;">
<p>本邮件最终解释权归股份有限公司所有</p>
<p>如有任何疑问,您可以拨打联系我们</p>
</div>
</div>
html2:
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr><th>尊敬的客户,您好!</th></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="line-height: 30px;">
<tr><td>您的电子发票已生成,发票信息如下:</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #eb5404;margin: 20px auto;">
<tr style="line-height: 30px;text-align: center; background: #fdefe5; color: #eb5404;">
<th style="border-right: 1px solid #eb5404;">电子发票代码</th>
<th style="border-right: 1px solid #eb5404;">电子发票号码</th>
<th>开票日期</th>
</tr>
<tr style="line-height: 30px;text-align: center;">
<td style="border-top: 1px solid #eb5404;border-right: 1px solid #eb5404;">1234567890</td>
<td style="border-top: 1px solid #eb5404;border-right: 1px solid #eb5404;">1234567890</td>
<td style="border-top: 1px solid #eb5404;">2018-11-12</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="line-height: 30px;">
<tr><td>您可点击 <a style="color: #eb5404;" href="#">进行发票查看,下载</a></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style="line-height: 30px; text-align: center;"><td>本邮件最终解释权归股份有限公司所有</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style="line-height: 30px; text-align: center;"><td>如有任何疑问,您可以服务热线</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style="line-height: 30px; text-align: center;"><td><a style="color: #eb5404;" href="#">联系我们</a></td></tr>
</table>
</body>
更多推荐
开发发邮件,outlook2016 收到邮件样式不对
发布评论