这是我用来检索 MS Outlook 邮件的代码 -
NameSpace _nameSpace;
ApplicationClass _app;
_app = new ApplicationClass();
_nameSpace = _app.GetNamespace("MAPI");
object o = _nameSpace.GetItemFromID(EntryIDCollection);
MailItem Item = (MailItem)o;
string HTMLbpdyTest = Item.HTMLBody;
CreationTime = Convert.ToString(Item.CreationTime);
Outlook.Recipients olRecipients = default(Outlook.Recipients);
olRecipients = Item.Recipients;
string strCcEmails = string.Empty;
foreach (Outlook.Recipient olRecipient in Item.Recipients)
{
if (olRecipient.Type == Outlook.OlMailRecipientType.olCC)
{
strCcEmails = olRecipient.Address;
}
}
在使用 MS Outlook 2010 中的 MAPI 检索 CC 电子邮件地址时,它以这种格式给出输出 -
strCcEmails = /O=EXG5/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=Test88067
如何获得准确的电子邮件地址?