iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Closed Thread
 
LinkBack (1) Thread Tools
Old August 12th, 2003, 06:56 AM   1 links from elsewhere to this Post. Click to view. #1
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
Email Address Validation

Heres a little function you can use to check your users enter valid email addresses:

<font color="blue">Function IsValidEmail(emailaddress)
Dim mc
Set mc = New RegExp
mc.Pattern = "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"

results = mc.Test(trim(emailaddress))
If results Then
IsValidEmail = True
Else
IsValidEmail = False
End If
End Function</font id="blue">



Cheers
Smokie
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old August 15th, 2003, 08:52 PM   #2
vor
New Member
 

Join Date: Aug 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 vor is on a distinguished road
Pretty kewl, but the Pattern seems alittle long.
I have a function like that but its in javascript

Code:
function isEmail(txt){
    var grep = /\S+@\S+\.\S{2,4}/gi //RegEx Pattern
    return (grep.exec(txt))? true:false;
}// end function
I believe \S+@\S+\.\S{2,4} should work in asp.
vor is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Bookmarks

Tags
email , address , validation


LinkBacks (?)
LinkBack to this Thread: http://webforumz.com/classic-asp/1407-email-address-validation.htm
Posted By For Type Date
Email address validation - Effective Email Address Validation - The Code Project - ASP.NET This thread Refback March 31st, 2007 10:48 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect your email address Ryan Fait JavaScript 3 January 7th, 2007 02:15 AM
originating email address is bad DennisK PHP 2 November 27th, 2006 06:44 PM
Registering an email address DennisK HTML, XHTML and CSS 4 November 25th, 2006 08:07 PM


Search Engine Optimization by vBSEO 3.2.0 RC8