Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common error Syntax e-mail address Correction C# Module or Tool

Status
Not open for further replies.

stardv

Technical User
May 27, 2004
33
US
Can anybody recommend were I can download the tool or module that checks e-mail address syntax and corrects common errors like for e-mail changes name@yaho.cm to name@yahoo.com

I am ready to pay for it as well.

Thank you
 
cm" is a valid extension - Cameroon - therefore, you would need to be very careful when automatically correctly addresses such as these.

A simple piece of client side JavaScript (or server side code) would be able to check the validity of an email address. Try a search on Google for "javascript email address validation" - you might like to add "regex" to the end of that search as well.

You could create your own list of values to confirm. "Are you sure you have entered your email address correctly?" could be a response to a ".cm" extension. No offence Cameroon residents. ;)

Hope this helps.

Pete.


Web Developer & Aptrix / IBM Lotus Workplace Web Content Management (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Thanks for advise.
This was just an example and I did not meant to disregard Cameroon. That is the reason why I do not want to create my own list because I ado not possess the list of all valid domains and I do not have to much time for coding. I just need to find something created and I am sure there should be some.
 
I don't think you'll find a list, since there are close to an infinite number of possible domain names and sub domains. The only thing you can do, is validate that the email address is in the correct format.

An ASP solution:

A JavaScript solution I use is:
Code:
function formValidateEmail(email) {
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	return regex.test(email);
}
This will return true if valid, otherwise false.

Hope this helps.

Pete.


Web Developer & Aptrix / IBM Lotus Workplace Web Content Management (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Thanks a lot.
I already have this simple validation written. I am trying to find something more robust and sophisticated.

Thanks for you advice anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top