Group AddressMembers Property
Get the members of the group.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
The list of members.
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public InternetAddressList Members { get; }Property Value
InternetAddressListThe list of members.
Remarks
Represents the member addresses of the group. If the group address properly conforms to the internet standards, every group member should be of the MailboxAddress variety. When handling group addresses constructed by third-party software, it is possible for groups to contain members of the GroupAddress variety.
When constructing new messages, it is recommended that address groups not contain anything other than MailboxAddress members in order to comply with internet standards.
Example
C#
public static void AddGroupRecipients (MimeMessage message)
{
// A group address is a named list of mailboxes. It will be serialized as:
// Friends: Rachel Green <rachel@friends.com>, Ross Geller <ross@friends.com>;
var friends = new GroupAddress ("Friends");
friends.Members.Add (new MailboxAddress ("Rachel Green", "rachel@friends.com"));
friends.Members.Add (new MailboxAddress ("Ross Geller", "ross@friends.com"));
message.To.Add (friends);
// A group with no members is a common way of hiding the list of recipients
// and will be serialized as: undisclosed-recipients: ;
message.Cc.Add (new GroupAddress ("undisclosed-recipients"));
}