469,323 Members | 1,539 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Sample Code to Verify Email Addresses

I want to write a Windows application to go through all the email addresses
in an SQL Server table and to report which ones are invalid. From Googling
and perusing NGs it is my understanding that the process to validate an
email address is done at 3 levels:
1. Verify that it is syntactically valid
2. Verify that the domain exists (SMTP verification)
3. Verify that the email address exists at that domain (MX verification)

The first one I can do with a regular expression or some Instr functions. I
am looking for some information (ideally code samples/classes) on how to
accomplish the other two levels of verification. Any pointers are
appreciated.

Wayne
Nov 21 '05 #1
2 5042
For number 2, it is simply a matter of doing a DNS lookup for an MX record
for the domain. Check out the System.Net.Dns class for this.

For number 3, you need to write a small app to converse with the SMTP server
determined by number 2. If I remember rightly it us the VERIFY command that
you need to use. You will need to read up on the RFC for the SMTP protocol,
copies of which are readily available on the internet.

Once you have 2 and 3 sussed out then number 1 is redundant.
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:OA**************@TK2MSFTNGP14.phx.gbl...
I want to write a Windows application to go through all the email addresses
in an SQL Server table and to report which ones are invalid. From Googling
and perusing NGs it is my understanding that the process to validate an
email address is done at 3 levels:
1. Verify that it is syntactically valid
2. Verify that the domain exists (SMTP verification)
3. Verify that the email address exists at that domain (MX verification)

The first one I can do with a regular expression or some Instr functions.
I
am looking for some information (ideally code samples/classes) on how to
accomplish the other two levels of verification. Any pointers are
appreciated.

Wayne

Nov 21 '05 #2
Thanks for that information. I'll go do a bit of reading.

Wayne

"Stephany Young" <noone@localhost> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
For number 2, it is simply a matter of doing a DNS lookup for an MX record
for the domain. Check out the System.Net.Dns class for this.

For number 3, you need to write a small app to converse with the SMTP
server determined by number 2. If I remember rightly it us the VERIFY
command that you need to use. You will need to read up on the RFC for the
SMTP protocol, copies of which are readily available on the internet.

Once you have 2 and 3 sussed out then number 1 is redundant.
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:OA**************@TK2MSFTNGP14.phx.gbl...
I want to write a Windows application to go through all the email
addresses
in an SQL Server table and to report which ones are invalid. From
Googling
and perusing NGs it is my understanding that the process to validate an
email address is done at 3 levels:
1. Verify that it is syntactically valid
2. Verify that the domain exists (SMTP verification)
3. Verify that the email address exists at that domain (MX verification)

The first one I can do with a regular expression or some Instr functions.
I
am looking for some information (ideally code samples/classes) on how to
accomplish the other two levels of verification. Any pointers are
appreciated.

Wayne


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by NotGiven | last post: by
2 posts views Thread by Hoang | last post: by
2 posts views Thread by Kindler Chase | last post: by
117 posts views Thread by Steevo | last post: by
3 posts views Thread by Grey | last post: by
rrocket
2 posts views Thread by rrocket | last post: by
7 posts views Thread by =?Utf-8?B?Tmlrb2xheSBQb2Rrb2x6aW4=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.