i need to know how to validate e-mail address in C#. am using a textBox to type the e-mail address and using "Submit" button to go the other form. before go to the next form it should be validate as an e-mail address.
thank you.
i need to know how to validate e-mail address in C#. am using a textBox to type the e-mail address and using "Submit" button to go the other form. before go to the next form it should be validate as an e-mail address.
thank you.
Try this method.
public bool IsValid(string emailaddress)
{
try
{
MailAddress m = new MailAddress(emailaddress);
return true;
}
catch (FormatException)
{
return false;
}
}