function —————————————————
' | author:i94self |
' | e_mail:i94self@hotmail.com |
' | HTTP://www.I94Self.com |
' | Please save author Information |
' —————————————————
''''''''''''''''''''''''''''''''
' Judge if E_Mail input is correct '
''''''''''''''''''''''''''''''''
Function Isvalide_mail (E_Mail)
' To determine if there is an @ symbol in the E_Mail address, if there is no @ symbol or the @ symbol at the first or last E_Mail character, then the function returns false and the function exits.
E_mailarray=split (E_Mail, "@")
If UBound (e_mailarray) <>1 Then
Isvalide_mail=false
Exit Function
End If
' Determine if there is a link in the E_Mail address. Symbols (including ...) or countless. Connected symbols), and if so, the function returns false and exits the function.
If InStr (E_Mail, "...") >0 Then
Isvalide_mail=false
Exit Function
End If
' Determine if the string in the E_Mail address has a. Character if there is no. symbol OR. The first of the E_Mail characters, the function returns false, and the function exits.
If InStr (E_mailarray (1), ".") <= 0 Then
Isvalide_mail = False
Exit Function
End If
' Judge the E_Mail address. The string after is equal to 2 characters or 3 characters, if not equal, the function returns false and the function exits.
Number=len (E_mailarray (1))-instrrev (E_mailarray (1), ".")
If number<>2 and Number<>3 Then
Isvalide_mail=false
Exit Function
End If
For each e_mailarraycontent in E_mailarray
' Determine if there are any characters before @ in the E_Mail address, and if not, the function returns false and exits the function.
If Len (e_mailarraycontent) <=0 Then
Isvalide_mail=false
Exit Function
End If
' Determine if the E_Mail address contains illegal characters except abcdefghijklmnopqrstuvwxyz_-and numbers, and if so, the function returns false and exits the function.
For Number=1 to Len (e_mailarraycontent)
E_mailstr=lcase (Mid (e_mailarraycontent,number,1))
If InStr ("abcdefghijklmnopqrstuvwxyz_-.", E_mailstr) <=0 and not IsNumeric (E_MAILSTR) Then
Isvalide_mail=false
Exit Function
End If
Next
' Determine if the first and last character in the string before and after the E_Mail address is. character, if it is, the function returns false and exits the function.
If Left (e_mailarraycontent,1) = "." Or Right (e_mailarraycontent,1) = "." Then
Isvalide_mail=false
Exit Function
End If
Next
' No exception characters found in E_Mail address, function returns True, function ends.
Isvalide_mail=true
End Function