|
-
March 17th, 2001, 10:10 PM
#1
validate email address
hi there, my VB application allow the user to enter his/her email address..how do i check whether the email that the user entered is of the right format...?? please help..thanks
-
March 18th, 2001, 12:50 AM
#2
Re: validate email address
Well .. a valid email should at least be in this format [email protected], so you can use the sample code below to check:
function ValidateEmail(szEmail as string) as boolean
dim nInd as integer
dim bValid as boolean
bValid = false ' by default - not valid
nInd = instr(1, szEmail, "@") ' get the @
if (nInd > 0) then
' found the @ then check for .
nInd = instr(nInd, szEmail, ".") ' get the .
if (nInd > 0) then
' found - probably a valid email
bValid = true
end if
end if
ValidateEmail = bValid
end function
-Cool Bizs
Good Luck,
-Cool Bizs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|