Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# cvalidate email


bool IsValidEmail(string email)
{
    if (email.Trim().EndsWith(".")) {
        return false; // suggested by @TK-421
    }
    try {
        var addr = new System.Net.Mail.MailAddress(email);
        return addr.Address == email;
    }
    catch {
        return false;
    }
}

Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #cvalidate #email
ADD COMMENT
Topic
Name
9+3 =