MailMessageGetAllRecipients Method
Gets the EmailAddressCollection object containing the e-mail addresses of all message recipients.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public EmailAddressCollection GetAllRecipients()

Return Value

Type: EmailAddressCollection
An EmailAddressCollection object containing the e-mail addresses of all message recipients.
Remarks
The entire collection of the message recipients consists of the e-mail addresses that are contained in the To, Cc and Bcc fields.
Examples
This sample loads the message from .EML file and displays the e-mail addresses of all message recipients.
using System;
using MailBee;
using MailBee.Mime;

class Sample
{
    static void Main(string[] args)
    {
        // Load the message from file.
        MailMessage msg = new MailMessage();
        msg.LoadMessage(@"C:\Docs\TestMail.eml");

        // Display the e-mail address of each message recipient.
        Console.WriteLine("The message has the following recipient(s):");
        foreach (EmailAddress adr in msg.GetAllRecipients())
        {
            Console.WriteLine(adr.Email);
        }
    }
}
See Also