我正在使用 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();
最佳答案
检查以下片段:
foreach (Outlook.Recipient recip in ReceivedEmails[0].Recipients)
{
Debug.WriteLine(recip.AddressEntry.GetExchangeUser().PrimarySmtpAddress.ToString());
}
如果您有任何问题,请告诉我:)!
关于c# - 如何从电子邮件中获取收件人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40912573/