Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MailKit ToMailAddressCollection Extension
public static class MailKitExts
{
public static MailAddressCollection ToMailAddressCollection(this InternetAddressList addressList)
{
if(addressList == null)
{
return new MailAddressCollection();
}
return addressList.Mailboxes.Aggregate(new MailAddressCollection(), (c, r) => { c.Add(new MailAddress(r.Address, r.Name)); return c; });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.