A Simple Check for a Valid Email Address Using VBScript

Category:
ASP, HTML and XML
Type:
Snippets
Difficulty:
Beginning
Author:
Anonymous

Version Compatibility: Visual Basic Script

More information:
You can use this to check for a valid email address when a form is submitted. It is pretty flimsy, but is good for quick check. Moreover, you can enhance it using the logic from some of the other examples on this site, such as the one at http://www.freevbcode.com/ShowCode.Asp?ID=201. This other snippet was developed for Visual Basic 5.0 and up, but is easily portable to VB Script.

It makes sure there is a "@", ".", and is at least 7 characters long.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: