再会,
如何减少/限制图像的大小作为 ac# 电子邮件中的内联附件?电子邮件中显示的图像非常大,我想将其缩小到 475px x 475px 左右。
HTML:
...
<td style="max-width: 475px; max-height: 475px">
<img style="width:475px; height: 475px;" id="Img1" src="cid:Product" />
</td>
<td style="width: 475px">
<div class="jamHeader">
<img id="jamHeaderImage" src="cid:Header" />
</div>
<div class="labelContainer">
<h1 class="title-block">
<p id="SoftwareName">"xxxxxxxxxx"</p>
</h1>
<div class="productInfo">
<div id="EmailDescription">
xxxxxxxxxx
This link expires in 24 hours if not redeemed."
</div>
</div>
</div>
</td>
...
附加图像的代码
if (!string.IsNullOrEmpty(productImage))
{
System.Net.Mail.Attachment product = new System.Net.Mail.Attachment(productImage);
product.ContentId = "Product";
product.ContentDisposition.Inline = true;
product.ContentDisposition.DispositionType = DispositionTypeNames.Inline;
message.Attachments.Add(product);
}
正如本网站所见,Outlook 2007 不再支持max-width
和css 样式。max-height
图像从磁盘读取,作为附件添加,并提供与 html 页面上的内容 ID 占位符图像标签匹配的内容 ID。图像不会调整到更小的比例,并且......它通过让页面上的其他元素感觉非常......非常小来吓唬页面上的其他元素。
我该如何克服呢?