Tools Links Login

ValidateEmail

Provides the user with a means of validating an email address. Using the like keyword, checks the email address with a specific pattern and will pick up on invalid chars for example, john.doe@.test.com will return false as would john.doe@com.

Original Author: Chris Priest

Inputs

strEmail - Email address that needs to be checked

Assumptions

The like statement allows pattern matching against the email address.
Like "*@[a-z,0-9]*.*"
This would allow anything before the @ sign, and the first letter after the @ sign must be either a number of letter and somewhere after that there must be at least one full stop

Returns

Boolean value indicating if email address is valid

Code

Public Function ValidateEmail(strEmail As String) As Boolean

ValidateEmail = strEmail Like "*@[A-Z,a-z,0-9]*.*"

End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 83 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.