3

With .NET's MailAddressCollection you call .Add(addresses) where addresses is a comma separated list of email addresses. Does Mimekit has an equivalent?

I don't want to just call String.Split because that doesn't take into account commas inside quoted names.

Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447

1 Answers1

6

With Mimekit, the easiest way is to use the static method InternetAddressList.Parse. Despite the name, this does handle email addresses.

Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
  • 2
    Yep! This is the correct method to use. The TryParse methods can also be used if you don’t want to deal with exceptions. – jstedfast Jan 26 '18 at 22:54