472,330 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,330 software developers and data experts.

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 5177
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: NotGiven | last post by:
Is there anyway to verify an email address before you send it? Does anyone know of a way to clean up an email address, like check for "me...
2
by: Hoang | last post by:
anyone know of an algorithm to filter out real email addresses as opposed to computer generated email addresses? I have been going through past...
5
by: Dan Williams | last post by:
Apologies for the cross-post but i thought i'd aim for the largest audience possible. I have a web site that users have to register to with their...
2
by: Kindler Chase | last post by:
win2k server IIS5 CDO Mail Using CDO mail, I'm looping through several email addresses and sending emails. Everything works fine, however, I'd...
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
2
by: darin dimitrov | last post by:
Hello, Is there a way to verify that a particular account exists on SMTP server before sending email to it in an ASP.NET web application?
3
by: Grey | last post by:
I have to write a program to verify email address availability. i have to verify thousand of email address. is there any way to verify the email in...
2
rrocket
by: rrocket | last post by:
I am trying to verify that the email addresses entered into our site are valid. Basically are they fake addresses or not and if I send them an email...
7
by: =?Utf-8?B?Tmlrb2xheSBQb2Rrb2x6aW4=?= | last post by:
Good afternoon, community! How you help me? I need to know, how could I verify e-mail address? I don't mean ( for example: test@test.com it...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.