c# - How to resize embedded images in email -
c# - How to resize embedded images in email -
i have next piece of code working fine, beingness able send email attachment.
i trying resize image width of 100px;
msg.isbodyhtml = true; attachment inlinelogo = new attachment(@"c:\desktop\image.jpg"); msg.attachments.add(inlinelogo); string contentid = "image"; inlinelogo.contentid = contentid; //to create image display inline , not attachment inlinelogo.contentdisposition.inline = true; inlinelogo.contentdisposition.dispositiontype = dispositiontypenames.inline; //to embed image in email msg.body = "<htm><body> <img src=\"cid:" + contentid + "\"> </body></html>";
edit: tried <img width="100" src=\"cid:" + contentid + "\">
not working,
how about:
msg.body = "<htm><body> <img width='100px' src=\"cid:" + contentid + "\"> </body></html>";
or w3c compliant:
msg.body = "<htm><body> <img style='width: 100px' src=\"cid:" + contentid + "\"> </body></html>";
c# html css email
Comments
Post a Comment