Advanced email validation component for Microsoft .NET
var engine = new VerificationEngine();
// ...
var result = engine.Run("bob@example.com",
VerificationLevel.Mailbox).Result;
switch (result.Status)
{
case VerificationStatus.Success:
// The mailbox exists
break;
case VerificationStatus.MailboxDoesNotExist:
// The mailbox does not exist
break;
case VerificationStatus.MailboxTemporarilyUnavailable:
// The mailbox is temporarily unavailable: we need to validate
// it again in a few minutes (greylisting)
break;
case VerificationStatus.MailboxValidationTimeout:
// A timeout occured while validating the mailbox; we need
// to increase the related settings value
break;
case VerificationStatus.ServerDoesNotSupportInternationalMailboxes:
// The local part of the address is in a non-ASCII encoding but
// the foreign mail exchanger can't handle this type of addresses
break;
case VerificationStatus.LocalSenderAddressRejected:
// The foreign mail exchanger rejected our sender address
break;
case VerificationStatus.SmtpConnectionFailure:
// A network failure happened while connecting to the foreign
// mail exchanger
break;
// TODO: Add more cases, if needed
default:
// ...
break;
}