Email verifier
Email verifier is a real time email address validation .NET class component.
It will do a DNS lookup for MX record, connect directly to remote SMTP server
and verify email address in real time.
It validates email address by sending a fake email and stop in the middle.
Since email delivery is not finished and there is no content inside email body,
email will not really be delivered to mail inbox.
However many SMTP server will give a error response if this inbox does not exists.
That is the way we can use to check whether this email address really exists or not.
Below is an example of possible SMTP command for email validation. C: means client or pc. S: means remote SMTP server.
name@yoursite.com is the email address you want to validate, mx1.yoursite.com is the assumed MX record.
c: open mx1.yoursite.com 25
s: 220 xxx Microsoft ESMTP Mail Service
c: ehlo
s: 250 OK
c: mail from: <name@yoursite.com>
s: 250 2.1.0 name@yoursite.com....Sender ok
c: rcpt to: <name@yoursite.com>
s: 250
The response after RCPT TO command is what
we can use to validate an email address.
In case that email address does not exists,
server may give a response like: 500 mailbox
not available.
download now
try it yourself
email address:
Code example
simple check:
use it when you don't need to know detail error information.
Dim strEmail as string = "test@yoursite.com"
if UmailUtility.EmailValidator.ValidateWithSmtp(strEmail) = False
' this is an invalid email address.
' do something here.
End if
SMTP check with detail information.
use it when you like to have detail error informaiton.
Dim strEmail as string = "test@yoursite.com"
Dim objCheck As UmailUtility.SmtpCheck = New UmailUtility.SmtpCheck
objCheck.EmailAddress = sEmail
objCheck.DoCheck()
If objCheck.isCheckOk = True And objCheck.IsValidEmail = False Then
' isCheckOk is used to indicate whether there is an error
' during checking procedure or not.
' example error maybe Remote SMTP server can not be reached.
' if isCheckOk = false, check did not succeed.
' only if isCheckOk = true and IsValidEmail = false,
' you can be sure that it is an invalid emaila ddress
' otherwise you have to assumed that it is valid email address.
Else
' it is an valid email address.
End If
|