发送带背景图html邮件(解决Outlook不显示背景图问题)
1、考虑兼容性问题,发送html邮件最好使用table tr td来布局,背景图使用
<td background="https://xqimg.imedao.com/1825f3baeeee1c73fd9dfb73.png!raw.jpg">
2、背景图为了兼容Outlook,使用VML(矢量可标记语言),条件注释判断Microsoft Outlook 版本
<!--[if(gte mso 9)|(IE)]>
<v:image xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style=" border: 0;display: inline-block; width: 688px; height: 1082px;" src="https://xqimg.imedao.com/1825f3baeeee1c73fd9dfb73.png!raw.jpg" />
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style=" border: 0;display: inline-block;position: absolute; width: 688px;
height: 1082px;">
<v:fill opacity="0%" color="#f7901e" /><v:textbox inset="0,0,0,0"><![endif]-->
<p>这里开始背景图片,邮件内容</p>
<!--[if(gte mso 9)|(IE)]>
</v:textbox>
</v:fill>
</v:rect>
</v:image>
<![endif]-->
(二)示例背景图
(三)示例定义好的html邮件图
(四)html代码
<table border="0" cellpadding="0" cellspacing="0" width="688" height="1042">
<tbody>
<tr>
<td background="https://xqimg.imedao.com/1825f3baeeee1c73fd9dfb73.png!raw.jpg" style="background-image: url(https://xqimg.imedao.com/1825f3baeeee1c73fd9dfb73.png!raw.jpg);">
<!--[if(gte mso 9)|(IE)]><v:image xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style=" border: 0;display: inline-block; width: 688px; height: 1082px;"
src="https://xqimg.imedao.com/1825f3baeeee1c73fd9dfb73.png!raw.jpg" /><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style=" border: 0;display: inline-block;position: absolute; width: 688px;
height: 1082px;"><v:fill opacity="0%" color="#f7901e" /><v:textbox inset="0,0,0,0"><![endif]-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="90%" style="padding-left:40px;">
<tbody>
<tr>
<td style="line-height:240px;height:240px;"></td>
</tr>
<tr>
<td style="line-height:34px;height:34px">
<strong><span style="font-family:微软雅黑, Microsoft YaHei;font-size:16px">亲爱的@Name:</span></strong>
</td>
</tr>
<tr>
<td style="line-height:34px;height:34px;padding-top:0px;">
<span style="font-family:微软雅黑, Microsoft YaHei;font-size:16px"> 今天, </span>
</td>
</tr>
<tr>
<td style="line-height:34px;height:34px">
<span style="font-family: 微软雅黑, "Microsoft YaHei""><span style="font-size: 16px;"