• Category Category: Coding
  • Comment Comments: 19
  • View View: 53438
  • View Word Count: 432

What are disposable email addresses?

Users may not trust a website with their email address because they may fear that will get spammed or that their email information will be leaked to third parties. So they use a disposable email to sign up on a website and use its features without providing the website with their email address.


Mailinator Disposable Email Service

A popular disposable email provider (Mailinator).


The Problem

However, an issue arises. What if the website needs to contact a user? What if the user is missing out on important information and news about the things they signed up for in the first place. Hence, the need to disallow users from registering with disposable emails on these websites becomes crucial.


The Solution

Below is some PHP code that will allow you to block disposable email addresses. Not that implementation of this code will require that you have some knowledge of PHP.


The function – Store this in a file called disposablecheck.php or something similar and upload it to some directory on your website.

What this function does is split apart an email address that is provided and compare its domain to an array of well known disposable email providers. It will be necessary to update this blacklist to keep out most of the well known disposable email providers. The function will return a 1 if a disposable email is detected and a if it one is not.


To update the array list, simply add a website domain without the @ sign at the end of the list (before the ); ) with double quotes surrounding it. Then add a comma to the end of this line. For example, if I wanted to add example.com, I would add:

So that the end of the list would look like:


The Check – Add this to your registration script or page. In the following code, $email is the variable that contains the email a user has indicated they want to sign up with. It runs the email through the function disposablecheck and then allows you to manipulate the result.

Typically you would provide an error or redirect the user  in scenario where no disposable email is detected and just let the script continue if no disposable email was detected. The following code is one way in which you can do this for a wordpress website.


The End Result

Before implementing this on one of my websites, I would get at least 15 low quality registrations a day. After this implementation that has decreased to zero! Low quality users often give up after trying a few disposable emails and move on to the next website. However, make sure you update the array blacklist as necessary.

Good luck!


About the Author Gold Star Staff Member

Mohammad Permalink: http://www.articlevoid.com/?action=permalink&article=50839
Website: https://mohammadg.com
About me: The webmaster of ArticleVoid. I own many other websites and I am fluent in X(HTML), PHP, Javascript, Java and C++. I spend a lot of my time online and currently own many websites. I love writing and created this website so users can share their knowledge in order to make the world just a little bit smarter!

  • authorBy:
  • writerPosted On:
  • live Published articles: 43

Comments (19)

  • Itz
    Itz (January 10, 2013 at 12:56 am)

    Hi Mohammad,

    one hard point is to keep the list of disposable domains up to date. Have you heared of http://www.block-disposable-email.com before? It could also be a good solution for your needs.

    Free for up to 200 queries a month.

  • fabian kessler
    fabian kessler (April 26, 2014 at 11:19 pm)

    It’s a simple approach to check against a local list, and probably covers 90% of all. Another web service with up-to-date lists is at http://www.nameapi.org/en/live-demos/disposable-email-address-detector/ (I work for them). You can query that easily with the PHP library from https://github.com/optimaize/nameapi-client-php

  • Richard MacLeod
    Richard MacLeod (May 21, 2014 at 2:53 pm)

    What is atarax?

    It is reduces an activity in the central nervous system. It also acts as an antihistamine that reduces the natural chemical histamine in the body. It is sneezing and runny nose, or hives on the skin. Atarax is used as a sedative to treat anxiety and tension. It is also used together with other medication given for anesthesia. It controls nausea and vomiting. And also used to treat allergic skin reaction such as hives or contact dermatitis. It may be purpose not listed in this medication guide.

    Important information about atarax?

    • Drinking alcohol can increase certain side effects of atarax.
    • Stop using hydroxyzine and call your doctor at once if you have a serious side effect such as confusion, seizure, or restless muscle movement in your eyes, tongue, or neck.
    • This medication may impair your thinking or reactions.
    • They do careful if you drive or do anything that requires you to be alert.
    • When you take hydroxyzine, tell your doctor if you have a seizure disorder, liver disease or kidney disease.

    How to use hydroxyzine :

    • This medication by mouth with or without food as directed by your doctor, usually three or four times daily.
    • Do not use a household spoon because you may not get the correct dose.
    • The dosage is based on your age, medical condition, and response to treatment. In children, the dosage may also be based on weight.
    • Do not increase your dose or take this medication more often than directed.
    • Drowsiness, dizziness, blurred vision, or dry mouth may occur. If any of these effects persist or worsen, tell your doctor or pharmacist promptly.
    • Many people using this medication do not have serious side effects.
    • You have any serious side effects, including: mental/mood changes (such as restlessness, confusion, and hallucinations), shaking difficulty urinating, fast/irregular heartbeat.
    • To relieve dry mouth, suck (sugarless) hard candy or ice chips, chew (sugarless) gum, drink water, or use a saliva substitute.
    • A very serious allergic reaction to this drug is rare. However, get medical help right away if you notice any symptoms of a serious allergic reaction, including: rash, itching.
    • Before using this medication, tell your doctor or pharmacist your medical history, especially of: breathing problems (such as emphysema, asthma), high pressure in the eye, heart problems.

    Missed dose :
    If it is near the time of the next dose, skip the missed dose and resume your usual schedule. Do not double the dose to catch up.

    Store at room temperature away from light and moisture. Do not store in the bathroom. Do not freeze liquid forms of this medication. Keep all medications away from children and pets. Do not flush medications down the toilet or pour them into a drain unless instructed to do so. Properly discard this product when it is expired or no longer needed.

    Hi friends, this is Richard MacLeod from UK. I am completed P.HD in Pharmacy. Now working in onlinepillmart.com as medical adviser. Also i write blog on Men’s and women’s health also other health related disease; like Zyrtec, Clarinex, Claritin, Xyzal, Allegra, Singulair etc. For more please visit : http://onlinepillmart.com/

  • Hatred
    Hatred (June 2, 2014 at 7:24 pm)

    No need to have duplicates like mailinator.com, .net, .org etc…

    Remove all the .com, .net, .org.. leave a period at the end just incase name has domain name in it (unlikely)

    Restrict all .info domains

    Restrict all e-mails with the word “Spam” in it.

    Do that, and your list is half as big.

    Searching through my users of over 10,000… this doesn’t effect any of them and if your worried simply write an error like (Disposable email detected, if this is an error.. contact blah@blah.com)

    No need to pay someone to check these stupid e-mails. Like he said.. they will probably try twice and give up.

  • Hatred
    Hatred (June 2, 2014 at 8:16 pm)

    Easier said then done… here’s an updated code tested on http://riseofchaos.com

    $fakemail = array(“spam”, “.info”, “clickemail.”, “0wnd.”, “minutemail.”, “2prong.com”, “3d-painting.”, “4warding.”, “9ox.”, “a-bc.”, “amilegit.”, “anonbox.”, “anonymbox.”, “antichef.”, “baxomale.”, “beefmilk.”, “binkmail.”, “bio-muesli.”, “bobmail.”, “bodhi.”, “bofthew.”, “brefmail.”, “bsnow.”, “bugmenot.”, “bumpymail.”, “casualdx.”, “chogmail.”, “cool.fr”, “correo.blogos.”, “cosmorph.”, “courriel.”, “courrieltemporaire.”, “curryworld.”, “cust.”, “dacoolest.”, “dandikmail.”, “deadaddress.”, “devnullmail.”, “dfgh.”, “digitalsanctuary.”, “discardmail.”, “dispos”, “w3internet.”, “dodgeit.”, “dodgit.”, “dontreg.”, “dumpyemail.”, “e4ward.”, “email60.”, “emailias.”, “emailinfive.”, “emailmiser.”, “emailtemporario.”, “emailwarden.”, “ephemail.”, “explodemail.”, “fakeinbox.”, “fakeinformation.”, “fastacura.”, “filzmail.”, “fizmail.”, “frapmail.”, “garliclife.”, “get1mail.”, “getonemail.”, “girlsundertheinfluence.”, “gishpuppy.”, “great-host.”, “gsrv.”, “guerillamail.”, “guerillamail.com”, “guerrillamail.”, “guerrillamailblock.”, “hotpop.”, “inboxclean.”, “incognitomail.”, “ipoo.”, “irish2me.”, “jetable.”, “junk1e.”, “kaspop.”, “kurzepost.”, “lifebyfood.”, “link2mail.”, “litedrop.”, “lookugly.”, “lopl.”, “lr78.”, “maboard.”, “mail.by”, “mezimages.”, “mail4trash.”, “mailbidon.”, “mailcatch.”, “maileater.”, “mailexpire.”, “mailin8r.”, “mailinator”, “mailincubator.”, “mailme.”, “mailnator.”, “mailnull.”, “mailzilla.”, “mbx.”, “mega.”, “meltmail.”, “mierdamail.”, “mintemail.”, “moncourrier.”, “monemail.”, “mt2009.”, “mycleaninbox.”, “mytrashmail.”, “neverbox.”, “nobulk.”, “nomail.”, “nomail2me.”, “nowmymail.”, “objectmail.”, “obobbo.”, “onewaymail.”, “ordinaryamerican.”, “owlpic.”, “pookmail.”, “proxymail.”, “punkass.”, “quickinbox.”, “rcpt.”, “recode.”, “recursor.”, “comsafe-mail.”, “safetymail.”, “sandelf.”, “selfdestructingmail.”, “shiftmail.com”, “mail.me”, “skeefmail.”, “slopsbox.”, “smellfear.”, “snakemail.”, “sneakemail.”, “sofort-mail.”, “sogetthis.”, “soodonims.”, “speed.1s.”, “suremail.”, “tempalias.”, “tempemail.”, “tempe-mail.”,”tempinbox.”, “tempomail.”, “temporaryemail.”, “temporaryinbox.”, “thankyou”, “thisisnotmyrealemail.”, “throwawayemailaddress.”, “tilien.”, “trash2009.”, “trash-amil.”, “trashmail.”, “trash-mail.”, “trashymail.”, “tyldd.”, “uggsrock.”, “wegwerfmail.”, “wh4f.”, “willselfdestruct.”, “wronghead.”, “wuzupmail.”, “xoxy.”, “yogamaven.”, “yopmail.”, “yuurok.”, “zippymail.”, “jnxjn.”, “trashmailer.”, “klzlk.”);

    function fakemail ($email){ global $fakemail;
    foreach ($fakemail as $fake){ if(preg_match(“/$fake/i”,”$email”)){ return true; } }

    // TO USE
    if(fakemail($email)){ $err=’Please use a real e-mail address. If this is an error, contact your@contactinfo.com‘; $email=”; }

  • MailTest
    MailTest (April 6, 2015 at 6:10 pm)

    http://mailtest.in is a FREE API which will help solve your problem, Mohammed.

  • Foxy
    Foxy (May 5, 2015 at 12:30 am)

    will use in some websites. thank you !

  • Johnny
    Johnny (May 12, 2015 at 10:33 pm)

    MailChimp has just blocked my account because I have too many bad emails, with so many disposable email addresses.
    If someone is in the same situation than me, and is not a developer :) you can use this website http://www.emailshoot.com to check you email list, and remove the bad emails (they have free offer)

  • Aghast
    Aghast (June 16, 2015 at 2:21 pm)

    Your premise is invalid. Most disposable email address services will forward one or more emails to the user. Many of them will forward ALL emails to the user. Until the user decides to end the relationship.

    If I sign up for your site, I probably want to hear from you. But I don’t want to hear from your friends, or the hackers that pwned your website.

    So please, leave my disposable email address alone. And don’t spam me. Then we’re both happy. :-)

  • notmi realname
    notmi realname (August 16, 2015 at 6:25 am)

    another vote for invalid premise.
    many sites provide simply mail forwarding of email addressed to a disposable address. they don’t become invalid or go away until the customer wants it to. and they won’t kill the address if you don’t sell or otherwise loose the email or the address isn’t scraped from a fwd’d email.

    people who use services like mailinator know the address will go away and they use it for that very reason – they want a temporary relationship only.

    why would you force a user to provide you with a (semi) permanent email address? that’s reminiscent of when radio shack demanded your phone number when making a purchase.

  • BDEmails
    BDEmails (February 19, 2017 at 8:54 am)


    You can try https://bdemails.com.
    Just leave me a message (via contact form from the email) and I can give you 100k free API request to try our service.


  • KL
    KL (May 25, 2017 at 8:49 am)

    Another approach might be to consider why users are doing that.

    You simply haven’t yet provided enough value, or earned enough trust, for the person to want to give the real email address.

    So why force them? Because if you do force them, when they don’t want to, you get one of two results a) they leave (I often do) or b) you get an “valid” email address they never use anyway, which they keep around just for this very purpose.

    The better way to do this is to allow sufficient exploration of the site and use of its features before forcing a registration– to earn the person’s trust and show your value. A great example of this is Discord, a great gamer chat site. You can use it without identifying yourself at all, but if you want some additional features you need to create an account. There’s a banner that tells you this, but in the meantime, you’re happily using the app, loving it and deciding you’ll give Discord your right arm if necessary.

    This is the future….at least the future I’m embracing. I’m planning to use a Discord like system on my site–an invitation to join, not a command!

  • αναζητηση εργασιας
    αναζητηση εργασιας (September 2, 2017 at 3:46 pm)

    Your method of explaining all in tjis piece off writing is really good, all can simply know it, Thanks a lot.

  • Corine
    Corine (October 8, 2017 at 6:56 pm)

    It’s a shame you don’t have a donate button! I’d definitely donate to this superb blog!
    I guess for now i’ll settle for book-marking and adding your
    RSS feed to my Google account. I look forward to
    brand new updates and will talk about this blog with
    my Facebook group. Talk soon!

  • Annabelle
    Annabelle (October 19, 2017 at 12:20 am)

    The expansion of the Internet makes it mandatory that companies cater
    to the internet portal and have a presence about this
    medium, as well. Some people consider it being a fun-filled activity while some indulge in it as being a hobby.
    Otherwise it might result in severe and detrimental complications and consequences.

  • Bari - Patras
    Bari - Patras (April 28, 2018 at 8:12 pm)

    Thanks tto my father who stated to me about this website, this website is genuinely amazing.

  • ac quy xe dien mini
    ac quy xe dien mini (May 31, 2018 at 5:15 pm)

    It is actually a nice and helpful piece of information.
    I’m satisfied that you just shared this helpful information with us.
    Please stay us up to date like this. Thank you for sharing.

  • klik66.net
    klik66.net (August 2, 2018 at 3:08 am)

    Thank you, I’ve just been searching for info about this subject for a long time and yours
    is the greatest I have came upon till now. However,
    what in regards to the bottom line? Are you positive in regards to the source?

  • Italy - Greece
    Italy - Greece (August 2, 2018 at 4:07 am)

    It’s an amazing post in favor of all the web viewers;
    they will obtain advantage fro it I am sure.

Post Comment

Most Recent Articles from Coding Category: