我在Html中创建了一个电子邮件签名并在Gmail签名选项卡中复制了浏览器输出,它适用于Gmail到Gmail或Gmail到雅虎。
但是当我在桌面上的Outlook中打开邮件时,徽标没有显示,我尝试使用html表作为here,
我的HTML标记:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Best Regards,</span><br><br>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<span style="text-align: left; color: #000000; font-family: 'Arial', sans-serif; font-size: 13pt; font-weight: bold">Mr. Xyz</span>
<td style="text-indent: -12.0em;">
<span style="text-align: right; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Email:
xyz@something.com</span>
</td>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">IT
Development Manager</span>
<td style="text-indent: -12.0em;">
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Ph No:
123456</span>
</td>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 0px; padding-top: 7px; padding-bottom: 4px; padding-right: 0px;">
<a href="http://www.example.com/"><img src="http://imgur.com/ZQhgPvj" nosend="1" border="0" alt="E Design" title="xyz.com"></a>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Address Line 1,
</span><br>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<br>
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #0000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Address Line 2.
</span>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<br>
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: green; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Please consider the environment before printing this e-mail.!
</span>
</td>
</tr>
</tbody>
</table>
</body>
</html>
预期输出:
我可以知道我做错了吗?
任何帮助都会很棒。
答案 0 :(得分:0)
Outlook使用Word作为电子邮件编辑器。您可以在MSDN的以下文章中阅读有关受支持和不受支持的HTML元素,属性和级联样式表属性:
img src =&#34; &#34;
您需要添加对加载到任何Web服务器的图像的引用,或者将图像添加为隐藏附件。因此,结果标记应如下所示:
img src =&#34; cid:attachmentName&#34;
string img = "<br/><p><o:p><img src=\"" + att.FileName
+ "\" width=1 height=1 border=0 /></o:p></p>";
item.HTMLBody = item.HTMLBody.Replace("</body>", img + "</body>");
string PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001E";
string HIDDEN_ATTACHMENT = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B";
var pa = att.PropertyAccessor;
if (pa != null)
{
pa.SetProperty(PR_ATTACH_CONTENT_ID, att.FileName);
pa.SetProperty(HIDDEN_ATTACHMENT, false);
}