Email validation Checks if a string is an valid email address

Function IsValidEmail( ByVal sString)
    Dim sEmail, nIndex, nDotIndex
    IsValidEmail = False
    sString = Trim(sString)
    nIndex = InStr(1, sString,  "@")
    If nIndex < 2 Then 
       Exit Function
    End If
    nDotIndex = InStrRev(sString, "." )
    If nDotIndex < nIndex + 1 Then
         Exit Function
    End If
    If InStr( nIndex + 1, sString, "@" ) > nIndex Then
        Exit Function
    End If
     If nDotIndex > Len( sString ) - 2 Then
        Exit Function
    End If
    IsValidEmail = True
End Function
Information and tips