EmailAddressValidatorVerify Method (String)
Validates e-mail addresses in the string array given.

Namespace: MailBee.AddressCheck
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public void Verify(
	string[] emails
)

Parameters

emails
Type: SystemString
The array containing the e-mail addresses to check for syntax and, optionally, for existence.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionemails is a null reference (Nothing in Visual Basic) or DnsServers collection is empty.
MailBeeUserAbortExceptionThe user code has aborted the component with Abort method.
Remarks

To analyze the results, subscribe to Verified event. To implement blacklist or whitelist, subscribe to Verifying event.

For more info and tutorials, refer to Getting started with Address Validator guide.

Examples
This sample verifies a bulk of 3 addresses. Multi-threading is not used. To activate multi-threading, set MaxThreadCount property.
using System;
using MailBee;
using MailBee.AddressCheck;
class Program
{
    // This method will be executed for each e-mail address in the bulk,
    // whenever it gets verified, with either positive or negative result.
    private static void valid_Verified(object sender, VerifiedEventArgs e)
    {
        Console.WriteLine("*** Verified ***");
        Console.WriteLine("Email: " + e.Email);
        Console.WriteLine("Result: " + e.Result.ToString());
        if (e.Reason != null)
        {
            Console.WriteLine("Reason: " + e.Reason.Message);
        }
        Console.WriteLine();
    }

    static void Main(string[] args)
    {
        EmailAddressValidator valid = new EmailAddressValidator("MN110-0123456789ABCDEF-0123");

        // To perform DNS MX lookup queries, we need some DNS servers for that.
        valid.DnsServers.Autodetect();

        // Logging into a file is not required for the component to work
        // but helpful for debugging and understanding things under the hood.
        valid.Log.Enabled = true;
        valid.Log.Filename = @"C:\Temp\log.txt";
        valid.Log.Clear();

        // Subscribe to event.
        valid.Verified += new VerifiedEventHandler(valid_Verified);

        // Populate an array with some e-mails. You can also use DataTable as a source.
        string[] emails = new string[] { "jdoe@company.com", "bob@example.com", "alice@domain.com" };

        // Run the verification in single-threaded mode.
        valid.Verify(emails);
    }
}
See Also