A C# implementation of the famous javascript mailcheck plugin
A C# library that suggests a right domain when your users misspell it in an email address.
PM> Install-Package FishAngler.MailCheck
var mailCheck = new MailCheck();
var suggestion = mailCheck.Suggest("[email protected]");
if (suggestion != null)
{
Debug.WriteLine($"Suggested email: {suggestion.Full}");
}
string[] domains = { "custom-domain.com", "hotmail.com", "gmail.com", "yahoo.com" };
string[] secondLevelDomains = { "custom-domain", "hotmail", "gmail", "yahoo" };
string[] topLevelDomains = { "com" };
var mailCheck = new MailCheck(domains, secondLevelDomains, topLevelDomains);
var suggestion = mailCheck.Suggest("[email protected]");
if (suggestion != null)
{
Debug.WriteLine($"Suggested email: {suggestion.Full}");
}
suggestion = mailCheck.Suggest("[email protected]");
if (suggestion != null)
{
Debug.WriteLine($"Suggested email: {suggestion.Full}");
}