Read Recipients
Enumerates the recipients of a MAPI message.
Code
using DRIT.Mail;
using DRIT.Mail.Mapi;
IMailMessage mail = MailFile.Load("message.msg");
MapiMessage mapi = mail.MapiMessage;
foreach (IMapiRecipient recipient in mapi.Recipients)
{
Console.WriteLine($"Name: {recipient.Name}");
Console.WriteLine($"Address: {recipient.EmailAddress}");
Console.WriteLine($"AddressType: {recipient.AddressType}");
Console.WriteLine($"Type: {recipient.Type}");
Console.WriteLine();
}
Remarks
Each recipient is represented by MapiRecipient, which implements
IMapiRecipient. The Type property indicates whether the recipient is a
primary (To), carbon-copy (Cc), or blind carbon-copy (Bcc) recipient.