473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 5250
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 @theend.co" The above has a space before "@" and is...
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 email archives in order to find friends email...
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 email address. The site then emails the user...
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 like to set a variable based on the success or not...
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 ..net instead. the requirement is to verify which...
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 there will be an inbox associated with that...
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 is valid or not) I wanna know is that real world...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.