Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# VSTO Outlook link image without it being embedded

I am trying to add an HTML link with an image as the anchor, but when I hit send, Outlook automatically embeds the image in the email which makes it more susceptible to being caught as spam.

Basically when I add the email, I get the results this guy was looking for by default, but with less code (granted he wanted to add the image AFTER the signature)

Here's my code:

var doc = Globals.ThisAddIn.Application.ActiveWindow().WordEditor;
var pic = doc.Application.Selection.InlineShapes.AddPicture("MY IMAGE URL", true);
doc.Application.Selection.Hyperlinks.add(pic, "MY URL");

This adds the picture, looks great and the picture shows up right when the user opens the email (without having to Allow images) but I've been warned that embedded images get caught as spam a lot, and I've seen a number of the sent emails end up in spam boxes.

Is this true that an embedded image is likely to be caught as spam (I find that weird cause this is the default way outlook handles when you insert some image/chart etc etc)?

How can I insert an image like standard HTML (with the image not being embedded in the actual email, even if that means the recipient has to allow the image to be shown)? I would rather them get the email than have it end up as spam.

like image 744
MattoTodd Avatar asked Oct 10 '22 06:10

MattoTodd


1 Answers

Yes it is true that spam filters are likely to mark your mails as junk unless your email is on a whitelist. The reason is that spammers switched to putting their (spam)text into one big image and send that to avoid detection. More about image spam can be found here on wikipedia

I'm would expect VSTO to honour this as well but I'm not sure. The default behavior in outlook is to embed all images. You can overrule this by changing a registry setting (outlook 2010)

In key HKCU\Software\Microsoft\Office\14.0\Outlook\Options\Mail\
Add a REG_DWORD named "Send Pictures With Document"
Set the value to 0 
like image 103
Eddy Avatar answered Oct 18 '22 03:10

Eddy