EmailAddressValidatorVerified Event |
Occurs once an e-mail addresses in a bulk series has been verified.
Namespace: MailBee.AddressCheckAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax Remarks You must subscribe to this event to check verification statuses of e-mail addresses in a bulk series.
For addresses which have been skipped from verification in
Verifying event, this event is not raised.
Note |
---|
This event is never raised by Verify(String) overload which processes a single address only (rather than a bulk). |
Note |
---|
This event is not available for .NET Core and UWP. |
Examples
This sample verifies a bulk of 3 addresses, using
Verified event. Data source is
DataTable.
To see how to use this event in case of
IDataReader, see
Verify(IDataReader, String) sample.
using System;
using MailBee;
using MailBee.AddressCheck;
class Program
{
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");
valid.DnsServers.Autodetect();
valid.Log.Enabled = true;
valid.Log.Filename = @"C:\Temp\log.txt";
valid.Log.Clear();
valid.Verified += new VerifiedEventHandler(valid_Verified);
string[] emails = new string[] { "jdoe@company.com", "bob@example.com", "alice@domain.com" };
valid.Verify(emails);
}
}
Imports System
Imports MailBee
Imports MailBee.AddressCheck
Class Program
Private Shared Sub valid_Verified(ByVal sender As Object, ByVal e As VerifiedEventArgs)
Console.WriteLine("*** Verified ***")
Console.WriteLine(("Email: " & e.Email))
Console.WriteLine(("Result: " & e.Result.ToString))
If (Not (e.Reason) Is Nothing) Then
Console.WriteLine(("Reason: " & e.Reason.Message))
End If
Console.WriteLine()
End Sub
Shared Sub Main(ByVal args() As String)
Dim valid As EmailAddressValidator = New EmailAddressValidator("MN110-0123456789ABCDEF-0123")
valid.DnsServers.Autodetect()
valid.Log.Enabled = True
valid.Log.Filename = "C:\Temp\log.txt"
valid.Log.Clear()
AddHandler valid.Verified, AddressOf valid_Verified
Dim emails() As String = New String() {"jdoe@company.com", "bob@example.com", "alice@domain.com"}
valid.Verify(emails)
End Sub
End Class
See Also