ReegexEmail

3 reasons why you should stop using regex email validation

As email is one of the most efficient ways of keeping in touch with your customers, your contact database is your most precious asset. However, keeping bad addresses out of your database is just as crucial as adding the good ones in. From poor delivery and response rates to damaging your sender reputation, mistakes and bogus emails input by users can negatively impact your marketing campaigns. A quick internet search will find many services purporting to verify bad emails. But are they all delivering the same level of service?

For most developers looking for a quick solution, the first point of call is usually a regular expression. Regex is complex to write, to debug and only does half the job.

Here are 3 more reasons why you should pull the plug on regex for validating your email addresses.

1) It’s too restrictive

More often than not regex is far too restrictive. Most of the regex examples available are incorrect and fail to cater for rarer email addresses for the user portion of an email address.

Does your verification account for the various characters and symbols people use in their email address? The RFC goes into the requirements of how email addresses need to be formatted, and there is a whole heap of variation! The local string (the part of the email address that comes before the @ permits a lot more characters than you might expect. !#$%&’*+-/=?^_`{|}~ are all valid characters so if you’re excluding these, you could be turning potential customers away. It’s also worth bearing in mind that your users may choose to filter their inbox by appending a modifier onto their address for example ‘email+spam@gmail.com’.

2) Regex doesn’t actually check…

a) Whether the domain even exists.

b) If the domain does exist – does it have a mail server that is routable? (MX records that point the internet to the mail server for that domain).

c) If the user account actually exists? Although perhaps syntactically correct, an email that passes Regex validation won’t be able to guarantee the existence of the user’s inbox.

3)  It lets in temporary addresses

Even with all of the above checks it’s not an easy task to check if an email address is “valid” as there are lots of 10/15 minute mailbox providers. These companies will create a random domain, register a mail server on it and give you a temporary email address for 10 minutes before closing it down again. These temporary addresses will pass all validity checks but still aren’t what most business would deem a valid, marketable email address and certainly not something you want to be wasting your marketing resource on.

So what’s the solution?

A good email validation tool will go way beyond checking the syntax of the email address or pinging a mail server. Businesses need to invest in a solution that conducts additional, rigorous checks in order for accurate and valid responses to be returned. Simply checking that emails contain an @ symbol and dots is just not enough. A good tool will also check that the domain exists and that it is able to receive inbound messages, all in real-time. 

Email verification from PCA Predict is available on a pay-as-you-go basis with no set up fees and no minimum usage limits. Our API makes it possible to integrate email address checks on your website, app or CRM forms – wherever you collect email addresses.