c# VSTO Outlook 链接图像而不嵌入

发布于 2024-11-29 10:29:48 字数 738 浏览 0 评论 0原文

我试图添加一个以图像作为锚点的 HTML 链接,但是当我点击发送时,Outlook 会自动将图像嵌入到电子邮件中,这使得它更容易被视为垃圾邮件。

基本上,当我添加电子邮件时,我会得到这个人默认正在寻找的结果,但代码较少(假设他想在签名后添加图像)

这是我的代码:

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");

这会添加图片,看起来很棒,并且当用户打开电子邮件时图片会立即显示(无需允许图像)但我'曾经去过警告说嵌入的图像经常被视为垃圾邮件,而且我已经看到许多发送的电子邮件最终进入了垃圾邮件箱。

嵌入的图像可能会被视为垃圾邮件,这是真的吗(我发现这很奇怪,因为这是当您插入一些图像/图表等时 Outlook 处理的默认方式)?

如何插入像标准 HTML 一样的图像(图像未嵌入实际电子邮件中,即使这意味着收件人必须允许显示图像)?我宁愿他们收到电子邮件,也不愿让它成为垃圾邮件。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

‖放下 2024-12-06 10:29:48

是的,垃圾邮件过滤器确实可能会将您的邮件标记为垃圾邮件,除非您的电子邮件位于白名单上。原因是垃圾邮件发送者转而将他们的(垃圾邮件)文本放入一张大图像中并发送以避免被发现。有关图像垃圾邮件的更多信息可以在维基百科上的此处找到,

我希望 VSTO 也能尊重这一点但我不确定。 Outlook 中的默认行为是嵌入所有图像。您可以通过更改注册表设置来推翻此设置(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 

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 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文