Brian Dunning's FileMaker Custom Functions

Email_FormatValidityTest ( someEmail )

Tests email format validity, giving a message about result.

  Be the first to rate this function Log in to vote

Dan Shockley   Dan Shockley - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Email_FormatValidityTest ( "some_person@example.com )
  Sample output:
"email address is valid"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function returns the "email address is valid" if the specified email uses valid syntax.
It returns a descriptive error message if something invalid is found.
It is an updated version of a function by Paul Turnbull (https://www.briandunning.com/cf/360), including ideas by Michael Rhodes (https://www.briandunning.com/cf/972).
It does NOT try to check for validity of the top-level domain (TLD) against some defined list, as that can change. It instead only checks for valid syntax.
Note that it does not allow certain rarely-used special characters in the local part that can be used if quoted or escaped, as that would increase complexity (have to test for valid escaping/quoting).

If you want a function that just returns True or False, you could either make a simpler custom function that calls this one, testing for the "email address is valid" message, or you could change the end of this function to: resultMsg = "email address is valid"

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: