Search code examples
c#textboxmaskedtextbox

Email mask for MaskedTextBox in C#


Does anyone have a ready email mask for MaskedTextBox?

e.g.

[email protected] / [email protected] / [email protected] / [email protected] /  

p.s. Please do not suggest RegEx!


Solution

  • try this

    bool IsValidEmail(string email)
    {
        try {
            var mail = new System.Net.Mail.MailAddress(email);
            return true;
        }
        catch {
            return false;
        }
    }