View Full Version : Email Validation

10-01-2003, 09:43 PM
I was wondering if anyone knows of a good server side email validation useing asp that does all the normal checks i.e. @ the .com but also checks when people put something like email@email.com where the first word is the same as the second word? another example is word@word.com

10-01-2003, 10:06 PM

This regular expression would work pretty good. I can build it into a function if you are unfamiliar with regexp.

As for making sure the mailbox and the domain aren't the same, I think writing a thing in asp would be the easiest.

You could do something like:

Function SameMail_Domain(strAddress)
Dim aryMail
aryMail=Split(strAddress, "@")
If aryMail(0)=Mid(aryMail(1),1,InstrRev(aryMail(1),".")-1) Then
End If
End Function

<% If SameMail_Domain("blah@blah.com") Then %>
<p>The e-mail is the same!</p>
<% End If %>

10-01-2003, 10:15 PM
I think this is Whammys stuff, but it really shows off regular expressions really well.


(This is whammys stuff, I only post it as a matter of reference)

10-02-2003, 01:59 AM
Thankyou both for the information, I am sure wammy wont mind very helpfull for sure! :thumbsup:

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum