473,395 Members | 1,442 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,395 software developers and data experts.

Programmatically check to make sure an e-mail address is legit.

I've seen web sites that check to make sure an e-mail address is valid. How
are they actually doing it? I'd like to integrate that into some code.

TIA - Jeff.
Jan 16 '08 #1
5 3221
Jeff,

You are going to want to check out RFC 822, specifically, the "address
specification":

http://www.faqs.org/rfcs/rfc822.html

There is a language in BNF form (I believe it is BNF) which details the
rules for a valid email address.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mufasa" <jb@nowhere.comwrote in message
news:ON**************@TK2MSFTNGP03.phx.gbl...
I've seen web sites that check to make sure an e-mail address is valid.
How are they actually doing it? I'd like to integrate that into some code.

TIA - Jeff.


Jan 16 '08 #2


http://www.cambiaresearch.com/c4/bf9...pressions.aspx

http://www.google.com/search?source=...ssion%22+email

Using regular expressions is the way to check for a valid form.

Do you just want simple or advanced (aka, the domain name actually exists?)?

aka, if they put in ab*@acme.com

Do you want to make sure there exists an "acme.com" ?

"Mufasa" <jb@nowhere.comwrote in message
news:ON**************@TK2MSFTNGP03.phx.gbl...
I've seen web sites that check to make sure an e-mail address is valid.
How are they actually doing it? I'd like to integrate that into some code.

TIA - Jeff.


Jan 16 '08 #3
On Wed, 16 Jan 2008 11:12:46 -0800, Mufasa <jb@nowhere.comwrote:
No guys - I don't want to check whether the formatting is right. I want
to
check if the e-mail address is actually a live e-mail address.

So if somebody tells me that their e-mail address is Je**@NoWhere.com, I
want to check to make sure that that e-mail address does actually exist.
There's no 100% reliable way. But you may find this thread useful:
http://groups.google.com/group/micro...e5d3321930326e

(Just ignore my input...I completely misunderstood the original question
and so my replies aren't very helpful :) ).

Pete
Jan 16 '08 #4
Using regular expressions is the way to check for a valid form.

Pedant mode: actually, you can't fully check using a regex - there are
some nesting variants in RFC822 that *cannot* be verified with a
single regex. You can, however, check for the common forms
(so*****@somewhere.something) - but this isn't the only legal form.

Actually, the best approach (with registration etc) is to simply send
them an e-mail to the address they have given (tell them you are going
to do this), and in the e-mail provide a link (or code) to use to
indicate that yes: they got the e-mail.

Marc
Jan 16 '08 #5
Aside from checking the validity of the syntax of the email address itself
(as others have already pointed out) you can check the DNS "MX" (mail
exchange) record on the domain exists. An email address can be syntactically
valid but still be a bogus address. Once you have the MX record, many mail
servers allow you to query for the existence of a given account.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Mufasa" wrote:
I've seen web sites that check to make sure an e-mail address is valid. How
are they actually doing it? I'd like to integrate that into some code.

TIA - Jeff.
Jan 16 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Doug Baroter | last post by:
Hi, I'm on SQL Server 2000, say, I have a table named , how I find if there is any column which has a formula in it? In other words, how to identify formula column programmatically? I've...
6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
4
by: Steven | last post by:
Does anyone know if there is a way to check the access permissions of different users using C#? I need to know if a user has full control or if they have read only access or none to a certain...
1
by: John Criswell | last post by:
I have created a radio button list programmatically. C# SqlConnection conn = new SqlConnection("data source=localhost; integrated security=true; initial catalog=pubs"); SqlCommand cmdAuthors =...
6
by: Matt Frame | last post by:
I have a client that has asked us to get a digital signature certificate and start digitally signing all files we pass between each other. I have heard of the subject and know about the certs but...
0
by: Pete Smith | last post by:
Hi, I would like to make sure that my webservice runs on the destination system. Does anybody know how to check programmatically if ASP.NET is enabled on IIS 6.0. An maybe also how to configure...
15
by: Oleg Subachev | last post by:
I need to programmatically invoke from other class Click event of the Button on my Form. Button.OnClick method is protected, not public. How to perform this ? Oleg Subachev
8
by: mark.norgate | last post by:
I've asked this question before, but still haven't solved it, so am asking again. I am programmatically adding a user control to the page in response to a button click. The user control consists...
1
by: romancoelho | last post by:
How can I programmatically check to see if windows installer 2.0 is installed? Is there a registry setting I can check? Thanks!
4
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.