EmailValidator


#1

If I execute the below code with the email address (testing email address but any email with a coma will pass) "spam@home.com," the validation returns “ValidationSuccess”.


Yet, if I then set the to address to this email address that passed validation I get the run time error "An exception of type ‘System.FormatException’ occurred in System.dll but was not handled in user code. Additional information: An invalid character was found in the mail header: ‘,’."

Shouldn’t the validation fail?


Aspose.Email.Verify.EmailValidator ev = new Aspose.Email.Verify.EmailValidator();
Aspose.Email.Verify.ValidationResult result;
Aspose.Email.Verify.ValidationPolicy policy = new Aspose.Email.Verify.ValidationPolicy();
policy = Aspose.Email.Verify.ValidationPolicy.SyntaxAndDomain;
ev.Timeout = 30;
ev.DnsServers = new string[] { “x.x.x.xxx”, “x.x.x.x”};
ev.Validate(EmailAddress, policy, out result);
if (result.ReturnCode == Aspose.Email.Verify.ValidationResponseCode.ValidationSuccess)
{
validationMessage = result.ReturnCode.ToString();
return true;
}


#2

Hi John,

Thank you for contacting Aspose Support team.

We have analyzed this issue at our end and it seems the EmailValidator is ignoring the “,” in the email address. We have logged it as EMAILNET-35126 in our issue tracking system for further investigation by our Product team. We’ll update you here once there is some information available in this regard.


#3

The issues you have found earlier (filed as EMAILNET-35126) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.