良い一日、
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);
}
このサイトで見られるように、max-width
およびmax-height
css スタイルは Outlook 2007 以降ではサポートされなくなりました。画像はディスクから読み取られ、添付ファイルとして追加され、html ページのコンテンツ ID プレースホルダー画像タグと一致するコンテンツ ID が与えられます。画像は小さい比率にサイズ変更されず、... ページ上の他の要素を本当に... 本当に小さく感じさせることで怖がらせます.
どうすればこれを克服できますか?