I have a VSTO Add-in for Outlook that appends an tag to the bottom of an email. It is done like this
string imageUrl = "http://imageurl.com/image.png"
HtmlNode imageNode = HtmlNode.CreateNode("<img src=\"" + imageUrl");
string htmlEmail = mailItem.HTMLBody
HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.LoadHtml(htmlEmail);
HtmlNode body = html.DocumentNode.SelectSingleNode("//body");
body.AppendChild(imageNode);
html.DocumentNode.WriteTo();
This works very well. However, I have recently noticed that for some users of the add-in the final HTML of the sent email actually looks like this
<img border=3D0 id=3D"_x0000_i1026" =
src=3D"cid:image007.png@01D1CB01.8E9D89F0" =
alt=3D"http://imageurl.com/image.png">
And on the bottom of the email I see
------=_NextPart_000_018A_01D1CB01.8F0E7430
Content-Type: image/png;
name="image007.png"
Content-Transfer-Encoding: base64
Content-ID: <image007.png@01D1CB01.8E9D89F0>
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMA
QObYZgAAAApJREFUCB1jYAAAAAIAAc/INeUAAAAASUVORK5CYII=
From what I understand instead of fetching the image when I view the email, the user's Outlook downloads the image and attaches it to the email somehow.
My question is: is there some setting in Outlook that makes this happen? Is there a way to change this setting? This is onl happening with some users so I am curious what causes this to happen.
Thank you!
I found a possible cause for this after digging deeper, though I am not sure if this is what is happening for this particular user.
Apparently, there is a setting that used to be out in the open for Outlook 2007 that made all outlook images automatically embed in the way that is described above. In 2010 or later this setting is bured in the Registry but is still there.
There are more details here: https://www.msoutlook.info/question/72