Validating Email Address Syntax
Using Aspose.network.Verify, we can verify the validity of email addresses. For this purpose, Aspose.Network.Verify has provided EmailValidator class.
The following example demonstrates how to use EmailValidator to validate an email address.
Example
[C#]
Aspose.Network.Verfiy.EmailValidator ev = new Aspose.Network.Verfiy.EmailValidator();
Aspose.Network.Verfiy.ValidationResult result;
ev.Validate("", out result);
if (result.ReturnCode == ValidationResponseCode.ValidationSucess)
{
MessageBox.Show("the email address is valid.");
}
else
{
MessageBox.Show("the mail address is invalid,for the {0}", result.Message);
}
[VB.NET]
Dim ev As New Aspose.Network.Verfiy.EmailValidator
Dim result As Aspose.Network.Verfiy.ValidationResult
ev.Validate("abc@aspose.com", result)
If (result.ReturnCode = Aspose.Network.Verfiy.ValidationResponseCode.ValidationSuccess) Then
MessageBox.Show("the mail address is valid")
Else
MessageBox.Show("the mail is invalid")
End If
Validating Domain
Using Aspose.network.Verify, we can verify the validity of domain name.
Validating Mail Server
Using Aspose.network.Verify, we can verify the validity of a mail server.