Block Disposable email domains from signing-up (PHP)

Sometimes it is really annoying to know that half of users’ emails bounced from the list, because they used some disposable emails to register on your site. Yes it happens a lot, only way to stop this from happening again is to stop users from signing up using any kind of disposable emails.

I’ve taken the list of some disposable email domains from here and converted it into array, it can also be stored in database if you want.

We will extract the domain from new email address and check if its domain exist in disposable list. This way we can block most disposable email address easily. Just make sure to update your list as you find new disposable email domain.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$disposable_list = array('drdrb.net', 'upliftnow.com', 'uplipht.com', 'venompen.com', 'veryrealemail.com', 'viditag.com', 'viewcastmedia.com', 'viewcastmedia.net', 'viewcastmedia.org', 'gustr.com', 'webm4il.in',
'wegwerfadresse.de', 'wegwerfemail.de', 'wetrainbayarea.com', 'wetrainbayarea.org', 'wh4f.org',
'whyspam.me', 'willselfdestruct.com', 'winemaven.in', 'wronghead.com', 'wuzup.net',
'wuzupmail.net', 'www.e4ward.com', 'www.gishpuppy.com', 'www.mailinator.com', 'wwwnew.eu',
'xagloo.com', 'xemaps.com', 'xents.com', 'xmaily.com', 'xoxy.net',
'yep.it', 'yogamaven.com', 'yopmail.fr', 'yopmail.net', 'ypmail.webarnak.fr.eu.org',
'yuurok.com', 'zehnminutenmail.de', 'zippymail.in', 'zoaxe.com', 'zoemail.org',
'inboxalias.com', 'koszmail.pl', 'tagyourself.com', 'whatpaas.com', 'emeil.in',
'azmeil.tk', 'mailfa.tk', 'inbax.tk', 'emeil.ir', 'crazymailing.com',
'mailimate.com');

$domain = substr(strrchr($email, "@"), 1); //extract domain name from email

if(in_array($domain, $disposable_list)){
echo "Disposable email not allowed";
}else{
echo "You are good to go";
}
  1. Hi, introduced and tested! Thanks a million this can also be used to block persistent spam mailers such as yandex.com! Thanks a million.

     Reply
Message Type : Question Comment ?
  • Question : Can include code, jsFiddle, codePen etc using Markdown Syntax.
  • Comment : Short comments and questions.