If you need to check if an email address really exists, this .Net component is for you.
How it works :
This free asp.net email validator/verifier component will check if an email address really exists by finding the mx records of the domain name, connecting to the mailbox’s smtp server and simulating the sending of an email (without really sending an email) and will test if a positive response is received to validate the address.
Features :
• Check Email Syntax (An accurate syntax check)
• Check if a domain name has MX records
• Read Mx records (get the mx records for a domain name or an email adress)
• Check SMTP Server (verify that the SMTP server is working and accept connections)
• Check Mailbox validity (connect to an email server directly via SMTP to check if mailbox is valid)
This component requires the Microsoft .NET framework and can be used in your website (webforms) or application (winforms).
Add a reference to the dll (or copy the file E-mail_Validator.dll to your bin directory)
It does not have a GUI front end, it is a component that can only be accessed programmatically, just create an instance :
Codicode.EmailValidator EV = new Codicode.EmailValidator();
please note that some mail servers always return a positive response even if the mailbox doesn’t exist.
C# code sample :
The following code will verify the validity of the email address, if no error was returned, then the email address is valid and can accept mails, if not and error message will be returned (account dosn't exist, no mx records, smtp timeout ...)
// We create an instance of our eMail-Validator Object
Codicode.EmailValidator Ev = new Codicode.EmailValidator();
// Set the Sender email (for smtp identification)
Ev.Mail_From = "admin@monoprog.com";
// Check if the email address is valid and really exists
string errorMsg = Ev.Check_MailBox_Error(tbEmail.Text);
if (errorMsg == "")
{
// the Mail Address/Smtp is valid and running
lbStatus.Text = "Mail OK";
}
else
{
// An error occured while validating the email
lbStatus.Text = errorMsg;
}
// Close and Dispose
Ev.Dispose();
The following code will retrive the MX records list from an email's domain name :
// We create our eMail Validator Object
Codicode.Emailvalidator Ev = new Codicode.Emailvalidator();
// Get the domain's MX records
string[] Mx_Records = Ev.FindMXRecords(tbEmail.Text);