Email Validation is not working

Hi there

I am using Aspose.Email 1.6.0.0. I am trying to validate my GMail and Hotmail address. But its always giving failure. Is there any change in the new versions as this feature was working earlier?
Sample file is attached.

Best Regards
Sajjad

Hi Sajjad,


Thank you for reporting this problem.

While using the latest version of Aspose.Email for .NET v1.6.0, I am able to observe your said problem (Gmail/Hotmail based email addresses are not verified). A ticket (NETWORKNET-33246) has been logged in our bug tracking system for correction purposes, and we will keep you posted with updates on this.

In your post, you have mentioned that you were able to get expected results with some previous version of Aspose.Email for .NET component. Could you please specify?

Regards,

Hi Sajjad,


It is to brief you on the current status of the ticket logged earlier as NETWORKNET-33246.

We have analysed your request and have concluded that your reported behaviour is actually not a bug of Aspose.Email component rather a mail server policy. Please note that some mail servers (like Gmail and Hotmail) have switched off the address checking feature to protect the mail accounts from spammers. Therefore, you may not be able to use Verify Email feature with such mail servers.

Thank you for your understanding and cooperation.

So what does Aspose returns in such cases: Valid? Invalid? or could not check?


Hi Luis,

Thank you for writing to us.

Please give a try to the following sample code by setting invalid and valid email addresses. Depending upon the server settings, some of them may validate it and others may not. If we use some Gmail account, it is detecting valid and invalid email addresses.

string emailToTest = "user@gmail.com";
EmailValidator ev = new EmailValidator();
ValidationResult result = new ValidationResult();

ev.Validate(emailToTest, ValidationPolicy.MailServer, out result);

if (result.ReturnCode == ValidationResponseCode.ValidationSuccess)
    Console.WriteLine("Email is valid");
else
    Console.WriteLine("Invalid email");

ev.Validate(emailToTest, ValidationPolicy.SyntaxAndDomain, out result);

if (result.ReturnCode == ValidationResponseCode.ValidationSuccess)
    Console.WriteLine("SyntaxAndDomain passed");
else
    Console.WriteLine("SyntaxAndDomain failed");

ev.Validate(emailToTest, ValidationPolicy.SyntaxOnly, out result);

if (result.ReturnCode == ValidationResponseCode.ValidationSuccess)
    Console.WriteLine("SyntaxOnly passed");
else
    Console.WriteLine("SyntaxOnly failed");