Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

IsValidEmailFormatƒ ( _email )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.6  (54 votes)
  Discuss this Custom Function

Michael Rhodes, Allied Data Service
http://allieddataservice.com

Validate email address

Sample Input:
IsValidEmailFormatƒ ( "mike@allieddataservice.com" )
Sample Output:
1


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Purpose

Since the number of top-level domains increases over time, this function assumes the top-level domain is legitimate and prohibits invalid email formats caused by other data entry error.

Returns 1 if the parameter is a correctly formatted email address.

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

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 17 comments

And actually, the '_email' definition in the let statement is circular, so '_email' is never actually defined. Either change the incoming parameter to '_email' (which would also fix my earlier comment), or add ' _email = text;' early in the let statement.


My new version:

/*
Created October 12, 2008
Updated January 1, 2012

Since top-level domains are constantly added, this function assumes top-level domain is legitimate and validates only the email format.
Returns True if parameter (_email) is correctly formatted.

By Michael Rhodes mike@allieddataservice.com
*/

IsEmpty ( text ) or // Comment out this line if you want to prohibit null values.
Let ( [
_email = text;
_alphanum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ;
_email = Trim ( _email ) ;
_posAt = Position ( _email ; "@" ; 1 ; 1 )
] ;
Filter ( _email ; _alphanum & "_-@.!#$%&'*+-/=?^_`{|}~" ) = _email // There are no invalid characters.
and PatternCount ( _email ; "@" ) = 1 // There is only one @ symbol.
and IsEmpty ( Filter ( Left ( _email ; 1 ) ; "@" ) ) // First and last character are alphanumeric.
and IsEmpty ( Filter ( Left ( _email ; 1 ) & Middle ( _email ; _posAt - 1 ; 3 ) & Right ( _email ; 1 ) ; "." ) )
and not Position ( _email ; ".." ; 1 ; 1 )
and Position ( _email ; "." ; _posAt + 2 ; 1 )
)

James David Ramsey, Columbus, OH
February 07, 2013 6:56am

I have to admit that I used James David Ramsey version of your function Michael.
Besides that I have to thank you for posting this here, saved me a lot of time !

With regards to both (Micheal and James)

Arjen van der Ree
Maxperts
Filemaker 13 Certified dude

Arjen van der Ree, Amsterdam
June 11, 2014 2:40am

Can you check the suffix against a list? For example an email with .com error fred13@gmail.cm

Tom, Seattle, WA USA
May 11, 2015 4:54pm

Thank you so much !

Jean-Luc

Jean-Luc Marechal, Dakar, Senegal
March 17, 2017 7:40am

_email is the name of the passed parameter. If you choose to name the parameter "text", then yes you will have to add _email = text in the let statement.

Michael Rhodes, Colorado Springs, USA
March 17, 2017 11:33am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 4 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
2. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
3. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
4. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
5. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)
6. ParseWebValueList( text )
  (Thu, Nov 02, 9:52am)
7. SVG_HTML_to_Text ( _svg_text ; _orig_text ;
  (Wed, Oct 25, 4:17am)
8. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)

RSS Feed of Custom Functions