How to: Get the E-Mail Address of a Recipient

This example shows how to get the Simple Mail Transfer Protocol (SMTP) address of a recipient.

In the following the code example, the GetSMTPAddressForRecipients method takes a MailItem object as an input argument and then displays the SMTP address of each recipient for that mail item. The method first retrieves the Recipients collection that represents the set of recipients specified for the mail item. For each Recipient in that Recipients collection, the method then obtains the PropertyAccessor object that corresponds to that Recipient object. Finally, the method uses the PropertyAccessor property to get the value of the MAPI property, which maps to the PR_SMTP_ADDRESS (PidTagSmtpAddress) property of the recipient.


using Outlook = Microsoft.Office.Interop.Outlook;
private void GetSMTPAddressForRecipients(Outlook.MailItem mail)
    const string PR_SMTP_ADDRESS =
    Outlook.Recipients recips = mail.Recipients;
    foreach (Outlook.Recipient recip in recips)
        Outlook.PropertyAccessor pa = recip.PropertyAccessor;
        string smtpAddress =
        Debug.WriteLine(recip.Name + " SMTP=" + smtpAddress);

Other Resources

Community Additions

© 2014 Microsoft