Bluepoint Design

Practical Cost-Effective Solutions
eMail Validation

Home
Up
Page last updated: 06/24/2009

eMail_Validation.mex

This macro does a crude job of validating a string of text as an email address. It uses tables of TLDs (Top Level Domains) and valid characters embedded within. To use it simply write the string the the Feedback registry string, run the macro, and read the Feedback registry string back out. If it's OK the response will be "Good" if there's something wrong the response will describe which test failed. For instance "$ is not a valid character". I'm sure it's not the most efficient approach but it's quick enough so I wasn't going to burn any time making an elegant version.

A brief rundown of the tests:

  1. Tests for blank user name, domain or TLD.
  2. Check that TLD is in list of known TLDs.
  3. Checks for invalid characters in user name.
  4. Test that domain name is greater than one character and less than 63 in length.
  5. Checks for invalid characters in domain name.

The motivating problem here is that the email ME utility doesn't handle invalid email addresses very well so I wrote this little diddy to intercept possible bad email addresses before stalling out the macro. However it's also nice for when users are inputting email addresses and such.

I think I covered all the bases but if you find something where the rules of validation are wrong please let me know so I can correct it. 

 

 
Practical Cost-Effective Solutions