VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



I have created this function which validates email through all possible combinations. you can inclu

by Umashankar Yadav (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 1st October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

I have created this function which validates email through all possible combinations. you can include it in the dll and use anywhere. It is

Rate I have created this function which validates email through all possible combinations. you can inclu



'//textbox or any control in which you are entering your email address.
'//Function returns a value if the validation is wrong it will return true
'//else false.

Public Function ValidateEmail(str As String) As Boolean
    
If str <> "" Then

        a1 = InStr(1, str, "@")
        a2 = InStr(1, str, ".")
    
        For i = 1 To Len(str)
            j = Mid(str, i, 1)
    
        If j = "@" Then
    
            a3 = a3 + 1
        
        
        End If
    
        Next
    
        a4 = InStr(1, str, "@.")
        a5 = InStr(1, str, "..")
        a6 = Mid(str, InStr(1, str, ".") + 1)
        a7 = InStr(1, str, ".@")
    
        If a1 <= 1 Or a2 <= 1 Or a3 > 1 Or a4 <> 0 Or a5 <> 0 Or Len(a6) < 2 Or a7 > 0 Then
    
            ValidateEmail = True
    
        Else
            
            ValidateEmail = False
        
        End If
        
Else

       ValidateEmail = False
       
End If

End Function





Download this snippet    Add to My Saved Code

I have created this function which validates email through all possible combinations. you can inclu Comments

No comments have been posted about I have created this function which validates email through all possible combinations. you can inclu. Why not be the first to post a comment about I have created this function which validates email through all possible combinations. you can inclu.

Post your comment

Subject:
Message:
0/1000 characters