A tiny .NET Core library for email normalization. Inspired by normailize
PM> Install-Package CanonicalEmails
var email = new MailAddress("[email protected]")
var normalized = Normalizer.Normalize(email) // => [email protected]
// or as extension
normalized = email.Normalize() // => [email protected]
var settings = new NormalizerSettings
{
RemoveDots = true, // Remove "." for applicable domains
RemoveTags = true, // Remove tags (ex: '+' and '-') for applicable domains)
LowerCase = true, // Lowercase
NormalizeHost = true // googlemail.com => gmail.com)
}
Normalizer.Normalize(email, settings)
// or globally
Normalizer.ConfigureDefaults(settings);
Support for gmail, hotmail, live.com, outlook, yahoo, protonmail and a few more.
MIT