我正在使用Outlook.Interop以便从收到的电子邮件中获取Html正文。 我正在尝试获取收件人的电子邮件地址,但只获取收件人的姓名而不是完整的电子邮件地址。
Application myApp = new ApplicationClass();
NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderInbox).Folders["digitel"];
List<MailItem> ReceivedEmails = new List<MailItem>();
foreach (MailItem mail in myInbox.Items)
{ ReceivedEmails.Add(mail); }
var Recipients = ReceivedEmails[0].Recipients.ToString();
答案 0 :(得分:4)
查看以下代码段:
foreach (Outlook.Recipient recip in ReceivedEmails[0].Recipients)
{
Debug.WriteLine(recip.AddressEntry.GetExchangeUser().PrimarySmtpAddress.ToString());
}
如果您有任何问题,请告诉我们:)!