Gets the EmailAddressCollection object containing the e-mail addresses of all message recipients.
An EmailAddressCollection object containing the e-mail addresses of all message recipients.
The entire collection of the message recipients consists of the e-mail addresses that are contained in the To, Cc and Bcc fields.
This sample loads the message from .EML file and displays the e-mail addresses of all message recipients.
[C#] 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); } } }
[Visual Basic] Imports System Imports MailBee Imports MailBee.Mime Module Sample Sub Main(ByVal args As String()) ' Load the message from file. Dim msg As 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):") For Each adr As EmailAddress In msg.GetAllRecipients() Console.WriteLine(adr.Email) Next End Sub End Module
MailMessage Class | MailBee.Mime Namespace