EmailVerify.NET - Verify multiple addresses at once code in VB.NET
The following example verifies a set of e-mail addresses all at the once, using EmailVerify.NET batch verification engine.
Upon finishing, the verification results are written to the console window.
Dim verifier = New EmailBatchVerifier()
' Set up some addresses to check
Dim addresses = New List(Of VerificationData)()
addresses.Add(New VerificationData("me@example.com", VerificationLevel.Disposable))
addresses.Add(New VerificationData("you@example.com", VerificationLevel.CatchAll))
' Start the batch processing asynchronously
Dim verificationResult As IAsyncResult = verifier.BeginBatchVerify(addresses)
' Use the standard thread pool to wait for the batch completion in parallel
ThreadPool.QueueUserWorkItem(Function(ByVal target As Object) Do
verifier.EndBatchVerify(verificationResult)
' At this point the whole batch is completed
For Each address In addresses
Console.WriteLine("Address: {0} -> {1}", address.EmailAddress, address.Status)
Next
End Function)