I would like to know of the possible ways to block disposable email addresses from registering in my website.
For simplicity, let's take the example where the registration form of the website is done with HTML and PHP.
Any ideas, solutions or suggestions would be greatly appreciated.
This would be tough to hardcode as disposable/temporary email domains appear every day from services like 10minutemail, guerrillamail etc. That being said you're probably better off integrating some managed up to date servcie like antideo email health API for example.
Endpoint:
api.antideo.com/email/nzk41997@xzsok.com
JSON response
Your php code will then look something like:
And then just look for the
boolean
likeThey also provide details about if the emails is known spammer/scammer or it's from a free provider like gmail, yahoo etc.
Disclaimer:
I know the guys from Antideo personally and I took a small part of building the service with them.
Stumbled upon this composer library MattKetmo/EmailChecker, has inbuilt Symphony2 and Laravel 5 support/config
There's this disposable email address detector web service http://www.nameapi.org/en/live-demos/disposable-email-address-detector/ (disclaimer: I work for them). It offers 10'000 free requests monthly. With the PHP client library https://github.com/optimaize/nameapi-client-php your userland code looks something like this:
If you meet all of these, then we won't have any need to use a disposable email to sign up to your service.
If you don't meet these, then people will sign up with disposable email accounts to protect themselves, and there's little you can do about it. Blocking legitimate disposable domains will just drive users to register burner accounts on domains like
hotmail.com
andgmail.com
, which you can't block.Here is a list I made, with the function to use it
This domain list is deprecated because it is now very old. You may try to build a new one.
Thought I would add to this answer as none was specified and it took me a while to find a solution.
What I am using is the blacklist method where you specify a list to block. It works well as users just give up after trying the biggest disposable email providers.
The code can be found here: How to Block Disposable Email Addresses: PHP Code
It works by letting you create an array of domains you which to block. You then provide an email address as a variable and this gets split to get the domain. This is compared to the list and as you can see on the website you can do whatever you like if a disposable email is detected.
Good luck!