C#中的Outlook加载项:获取邮件头? [英] Outlook add-in in C#: get message header?

查看:337
本文介绍了C#中的Outlook加载项:获取邮件头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,伙计们!

我不能做简单的事情:获取电子邮件的标题!我在C#(VS2015)中编写了VSTO加载项以定位Outlook 2013.我可以检索当前消息(我手中有MailItem对象),但它没有与原始标头对应的内容!我在MailItem界面中有一些预先准备好的字段,但它们没用 - 我需要收到SPF标题!

MS再次将整个世界视为愚蠢,并用最丑陋的解决方案帮助我们他们可以创造!而不是提供简单的Dictionary< string,string>他们把常用标题作为字段 - 哇!而这些愚蠢的人研究我们如何编程......胡说八道!



如此简短的问题:如何从消息中获取整个标题?

Hello, guys!
I cannot do simple stuff: get header of email! I wrote VSTO add-in in C# (VS2015) to target Outlook 2013. I can retrieve current message (and I have in hands MailItem object), but it has nothing corresponding to the raw header! I have a few "preparsed" fields inside MailItem interface, but they are useless - I need "Received-SPF" header!
MS again counts a whole world as stupids and "helps" us with ugliest solution they could create! Instead of providing simple Dictionary<string, string> they made "common used headers" as fields - whoa! And these dumbs study us how to program.... nonsense!

So short question: how to get a whole header from message?

推荐答案

您可以通过propertyaccessor访问每个邮件的属性,如下所示:



You can access the properties of each mail item via the propertyaccessor like this:

Const PR_TRANSPORT_MESSAGE_HEADERS = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"

Outlook.PropertyAccessor olPA = olkMsg.PropertyAccessor;
String Header = olPA.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS);


这篇关于C#中的Outlook加载项:获取邮件头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆