Código:
function validarEmail(chr_Email) dim strCounter, strCounter2, ok strCounter=0 strCounter2=0 chr_Email = lCase(chr_Email) if len(Chr_Email)>80 or len(Chr_Email)<6 then Ok = FALSE else dim checkOK checkOK = "abcdefghijklmnopqrstuvwxyz0123456789-_.@" for i=1 to len(Chr_Email) for j=1 to len(checkOK) if mid(Chr_Email,i,1) = mid(checkOK,j,1) then if mid(Chr_Email,i,1) = "@" then strCounter = strCounter + 1 end if if mid(Chr_Email,i,1) = "." then strCounter2 = strCounter2 + 1 end if ok=TRUE exit for else ok=FALSE end if next next if ok=TRUE then if strCounter=1 and strCounter2>0 and inStr(Chr_Email,"..")=0 and inStr(Chr_Email,".@")=0 and inStr(Chr_Email,"@.")=0 and inStr(Chr_Email,"@")>2 and inStr(Chr_Email,"@")<>len(Chr_Email) and inStr(Chr_Email,".")>2 and inStr(Chr_Email,".")<>len(Chr_Email) then if len(chr_Email)-instrRev(Chr_Email,".")>1 and len(chr_Email)-instrRev(Chr_Email,".")<7 then strCounter= mid(chr_Email, instrRev(Chr_Email,".")+1, len(chr_Email)) checkOK = "abcdefghijklmnopqrstuvwxyz" for i=1 to len(strCounter) for j=1 to len(checkOK) if mid(strCounter,i,1) = mid(checkOK,j,1) then ok=TRUE exit for else ok=FALSE end if next if ok=FALSE then exit for end if next else ok=FALSE end if else ok=FALSE end if end if end if validarEmail= Ok end function