好像没有什么办法,只能确定email是否合法性
确定合法性可以给你个例子
x = "ab@cb@ass@"
y = "@"
yyy = Replace(x, y, "")
xxx = Len(x) - Len(Replace(x, y, ""))
if xxx<>1 then
MsgBox "合法"
else
MsgBox "不合法"
end if
'检查Email的合法性
Public Function GetEmailAddress(strEmail)
If IsNull(strEmail) Or strEmail = "" Or Len(strEmail) = 0 Then Exit Function
Dim intLen As Integer
intLen = Len(strEmail)
Dim intAt, intName, intDomain As Integer
'查@的位置
For intAt = 1 To intLen
Dim strLetter
strLetter = Mid(strEmail, intAt, 1)
Select Case strLetter
Case "@"
GoTo CheckName
End Select
Next
GetEmailAddress = Null
Exit Function
CheckName:
Dim strName As String
strName = Left(strEmail, intAt - 1)
intLen = Len(strName)
For intName = 0 To intLen - 1
strLetter = Mid(strName, intLen - intName, 1)
Select Case strLetter
Case " "
GoTo CheckDomain
Case "/"
GoTo CheckDomain
Case "\"
GoTo CheckDomain
Case ":"
GoTo CheckDomain
Case "'"
GoTo CheckDomain
Case ";"
GoTo CheckDomain
End Select
Next
CheckDomain:
Dim strDomain As String
strDomain = Right(strEmail, Len(strEmail) - intAt)
intLen = Len(strDomain)
For intDomain = 1 To intLen
strLetter = Mid(strDomain, intDomain)
Select Case strLetter
Case " "
GoTo Final
Case "\"
GoTo Final
Case "/"
GoTo Final
Case ":"
GoTo Final
Case ";"
GoTo Final
Case ","
GoTo Final
End Select
Next