A tiny .NET Core library for email normalization. Inspired by normailize
PM> Install-Package CanonicalEmails
var email = new MailAddress("jane.doe+foo@gmail.com")
var normalized = Normalizer.Normalize(email) // => janedoe@gmail.com
// or as extension
normalized = email.Normalize() // => janedoe@gmail.com
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