Skip to content

Email normalization: jane.doe+foo@gmail.com => janedoe@gmail.com. Will normalize emails to their canonical form for Google, Microsoft, FastMail, Yahoo and more.

License

Notifications You must be signed in to change notification settings

naile/canonical-emails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CanonicalEmails

Build status CanonicalEmails

A tiny .NET Core library for email normalization. Inspired by normailize

Installation

PM> Install-Package CanonicalEmails

Usage

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
    

Configuration

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.

License

MIT

About

Email normalization: jane.doe+foo@gmail.com => janedoe@gmail.com. Will normalize emails to their canonical form for Google, Microsoft, FastMail, Yahoo and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages