4,152 questions
It depends on how many emails you need to validate. If they're just a few, you can use MailAddres or even use a Regular Expression for it.
var pattern = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$";
if(Regex.IsMatch(val ?? "", pattern))
// Do what you want
Another thing to think about is throw an exception... Do you really need it? All exceptions have a cost, so can be more efficient just do nothing.
Here's a complete example
// Let's supose you already have a property Email being filled with addresses separated by coma
public void OnSubmit()
{
const string pattern = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$";
var validEmails = new List<string>();
foreach(var item in Email.Split(","))
{
if(Regex.IsMatch(item ?? "", pattern))
validEmails.Add(item);
}
// Now you have a list with only valid emails
...
}