473,289 Members | 1,829 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,289 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 5246
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.