我正在使用以下代码读取来自 MS Outlook 2010 的传入邮件 -
public static void outLookApp_NewMailEx(string EntryIDCollection)
{
NameSpace _nameSpace;
ApplicationClass _app;
_app = new ApplicationClass();
_nameSpace = _app.GetNamespace("MAPI");
object o = _nameSpace.GetItemFromID(EntryIDCollection);
MailItem Item = (MailItem)o;
string HTMLbpdyTest = Item.HTMLBody;
string CreationTime = Convert.ToString(Item.CreationTime);
string strEmailSenderEmailId = Convert.ToString(Item.SenderEmailAddress);
string strEmailSenderName = Item.SenderName;
string Subject = Item.Subject;
}
如何获取发件人的邮件 ID。我试过Item.SenderEmailAddress
了,但它没有给我发件人的电子邮件 ID。它给了我这样的东西-
/O=EXG5/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=TEST35345