...

View Full Version : Email Validation



Crash1hd
10-01-2003, 10: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

oracleguy
10-01-2003, 11:06 PM
http://regexlib.com/REDetails.aspx?regexp_id=284

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
SameMail_Domain=True
Else
SameMail_Domain=False
End If
End Function
%>

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

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

http://www.solidscripts.com/downloads/functions.txt

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

Crash1hd
10-02-2003, 02: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