MailMessageGetAllRecipients Method |
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public EmailAddressCollection GetAllRecipients()
Public Function GetAllRecipients As EmailAddressCollection
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)
{
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
Console.WriteLine("The message has the following recipient(s):");
foreach (EmailAddress adr in msg.GetAllRecipients())
{
Console.WriteLine(adr.Email);
}
}
}
Imports System
Imports MailBee
Imports MailBee.Mime
Module Sample
Sub Main(ByVal args As String())
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
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
See Also