在 Outlook 2007 加载项中获取邮件源

发布于 2024-08-29 12:34:44 字数 448 浏览 3 评论 0原文

我正在编写一个插件,可以对收到的电子邮件正文进行一些处理。由于电子邮件通常是对以前电子邮件的回复,因此我需要首先删除以前电子邮件的内容。

问题就在这里...如果我使用 MailItem.Body 字符串,我会得到由 Outlook 处理的内容,并且不包含任何“>”通常表示前面内容的字符。我可以使用正则表达式并查找诸如“On X, Y write”之类的内容来查找上一封电子邮件的开始位置,但这并不总是很好。例如,当您收到一封电子邮件,其中内容写在上一封电子邮件的行之间时,它就会失败。

因此我的问题是:在 Outlook 中是否有可能以某种方式获取电子邮件的实际来源。我所说的来源是指您在 Thunderbird 视图 -> 消息源中按下时看到的内容。此内容包含“Delivered-To:”、“Return-Path:”等标签,...以及未处理版本的邮件正文(带有“>”字符)。

预先感谢您的任何帮助, 格雷戈尔

I'm writing an add-in that would do some processing on the body of the received emails. Since emails are often replies to previous emails I need first to remove the content of previous emails.

And here lies the problem... If I use the MailItem.Body string I get the content that was processed by Outlook and doesn't contain any '>' characters that usually indicate the previous content. I can use regular expressions and look for content such as "On X, Y wrote" to find where the previous email begins but this doesn't always work nicely. It fails, for example, when you receive an email where the content was written between the lines of the previous email.

Therefore my question is: Is it possible in Outlook to somehow get the actual source of the email message. By source I mean the content which you see if you press in Thunderbird View->Message Source. This content contains tags like "Delivered-To:", "Return-Path:", ... and also the mail body in unprocessed version (with ">" chars).

Thank you in advance for any help,
Gregor

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

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

发布评论

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

评论(1

甜味超标? 2024-09-05 12:34:44

我对识别已转发或回复的电子邮件也有类似的要求。如果消息是内部消息,它将有一个消息 ID 和一个参考 ID 列表。这些都可以在消息的标头数据中找到。

查看这篇文章:

使用 Visual Studio 2008 / VSTO / Outlook 提取 RFC 822 标头数据

并创建相关的 VSTO 窗格。查看收到的消息,看看其中是否有您正在寻找的内容... HTH

I have similar requirements about identifying emails which have been forwarded or replied too. If the message is internal it will have a message ID and a list of reference IDs. That is all found in the Header data of the message.

Check out this article:

Using Visual Studio 2008 / VSTO / Outlook to Pull Out RFC 822 Header Data

and create the VSTO pane in question. View the incoming messages to see if it has what you are looking for... HTH

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