I am using below code to read incoming mails from 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;
}
How can I get sender's mail id. I tried Item.SenderEmailAddress
but its not giving me the sender's email id. It is giving me something like this -
/O=EXG5/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=TEST35345
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…