How to Block Disposable Email Addresses: PHP Code

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.

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 0 if it one is not.

PHP

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

<?php

functiondisposablecheck($email){

$blacklist=array(

"0815.ru0clickemail.com",

"0wnd.net",

"0wnd.org",

"10minutemail.com",

"20minutemail.com",

"2prong.com",

"3d-painting.com",

"4warding.com",

"4warding.net",

"4warding.org",

"9ox.net",

"a-bc.net",

"amilegit.com",

"anonbox.net",

"anonymbox.com",

"antichef.com",

"antichef.net",

"antispam.de",

"baxomale.ht.cx",

"beefmilk.com",

"binkmail.com",

"bio-muesli.net",

"bobmail.info",

"bodhi.lawlita.com",

"bofthew.com",

"brefmail.com",

"bsnow.net",

"bugmenot.com",

"bumpymail.com",

"casualdx.com",

"chogmail.com",

"cool.fr.nf",

"correo.blogos.net",

"cosmorph.com",

"courriel.fr.nf",

"courrieltemporaire.com",

"curryworld.de",

"cust.in",

"dacoolest.com",

"dandikmail.com",

"deadaddress.com",

"despam.it",

"devnullmail.com",

"dfgh.net",

"digitalsanctuary.com",

"discardmail.com",

"discardmail.de",

"disposableaddress.com",

"disposemail.com",

"dispostable.com",

"dm.w3internet.co.uk example.com",

"dodgeit.com",

"dodgit.com",

"dodgit.org",

"dontreg.com",

"dontsendmespam.de",

"dump-email.info",

"dumpyemail.com",

"e4ward.com",

"email60.com",

"emailias.com",

"emailinfive.com",

"emailmiser.com",

"emailtemporario.com.br",

"emailwarden.com",

"ephemail.net",

"explodemail.com",

"fakeinbox.com",

"fakeinformation.com",

"fastacura.com",

"filzmail.com",

"fizmail.com",

"frapmail.com",

"garliclife.com",

"get1mail.com",

"getonemail.com",

"getonemail.net",

"girlsundertheinfluence.com",

"gishpuppy.com",

"great-host.in",

"gsrv.co.uk",

"guerillamail.biz",

"guerillamail.com",

"guerillamail.net",

"guerillamail.org",

"guerrillamail.com",

"guerrillamailblock.com",

"haltospam.com",

"hotpop.com",

"ieatspam.eu",

"ieatspam.info",

"ihateyoualot.info",

"imails.info",

"inboxclean.com",

"inboxclean.org",

"incognitomail.com",

"incognitomail.net",

"ipoo.org",

"irish2me.com",

"jetable.com",

"jetable.fr.nf",

"jetable.net",

"jetable.org",

"junk1e.com",

"kaspop.com",

"kulturbetrieb.info",

"kurzepost.de",

"lifebyfood.com",

"link2mail.net",

"litedrop.com",

"lookugly.com",

"lopl.co.cc",

"lr78.com",

"maboard.com",

"mail.by",

"mail.mezimages.net",

"mail4trash.com",

"mailbidon.com",

"mailcatch.com",

"maileater.com",

"mailexpire.com",

"mailin8r.com",

"mailinator.com",

"mailinator.net",

"mailinator2.com",

"mailincubator.com",

"mailme.lv",

"mailnator.com",

"mailnull.com",

"mailzilla.org",

"mbx.cc",

"mega.zik.dj",

"meltmail.com",

"mierdamail.com",

"mintemail.com",

"moncourrier.fr.nf",

"monemail.fr.nf",

"monmail.fr.nf",

"mt2009.com",

"mx0.wwwnew.eu",

"mycleaninbox.net",

"mytrashmail.com",

"neverbox.com",

"nobulk.com",

"noclickemail.com",

"nogmailspam.info",

"nomail.xl.cx",

"nomail2me.com",

"no-spam.ws",

"nospam.ze.tc",

"nospam4.us",

"nospamfor.us",

"nowmymail.com",

"objectmail.com",

"obobbo.com",

"onewaymail.com",

"ordinaryamerican.net",

"owlpic.com",

"pookmail.com",

"proxymail.eu",

"punkass.com",

"putthisinyourspamdatabase.com",

"quickinbox.com",

"rcpt.at",

"recode.me",

"recursor.net",

"regbypass.comsafe-mail.net",

"safetymail.info",

"sandelf.de",

"saynotospams.com",

"selfdestructingmail.com",

"sendspamhere.com",

"shiftmail.com",

"****mail.me",

"skeefmail.com",

"slopsbox.com",

"smellfear.com",

"snakemail.com",

"sneakemail.com",

"sofort-mail.de",

"sogetthis.com",

"soodonims.com",

"spam.la",

"spamavert.com",

"spambob.net",

"spambob.org",

"spambog.com",

"spambog.de",

"spambog.ru",

"spambox.info",

"spambox.us",

"spamcannon.com",

"spamcannon.net",

"spamcero.com",

"spamcorptastic.com",

"spamcowboy.com",

"spamcowboy.net",

"spamcowboy.org",

"spamday.com",

"spamex.com",

"spamfree24.com",

"spamfree24.de",

"spamfree24.eu",

"spamfree24.info",

"spamfree24.net",

"spamfree24.org",

"spamgourmet.com",

"spamgourmet.net",

"spamgourmet.org",

"spamherelots.com",

"spamhereplease.com",

"spamhole.com",

"spamify.com",

"spaminator.de",

"spamkill.info",

"spaml.com",

"spaml.de",

"spammotel.com",

"spamobox.com",

"spamspot.com",

"spamthis.co.uk",

"spamthisplease.com",

"speed.1s.fr",

"suremail.info",

"tempalias.com",

"tempemail.biz",

"tempemail.com",

"tempe-mail.com",

"tempemail.net",

"tempinbox.co.uk",

"tempinbox.com",

"tempomail.fr",

"temporaryemail.net",

"temporaryinbox.com",

"thankyou2010.com",

"thisisnotmyrealemail.com",

"throwawayemailaddress.com",

"tilien.com",

"tmailinator.com",

"tradermail.info",

"trash2009.com",

"trash-amil.com",

"trashmail.at",

"trash-mail.at",

"trashmail.com",

"trash-mail.com",

"trash-mail.de",

"trashmail.me",

"trashmail.net",

"trashymail.com",

"trashymail.net",

"tyldd.com",

"uggsrock.com",

"wegwerfmail.de",

"wegwerfmail.net",

"wegwerfmail.org",

"wh4f.org",

"whyspam.me",

"willselfdestruct.com",

"winemaven.info",

"wronghead.com",

"wuzupmail.net",

"xoxy.net",

"yogamaven.com",

"yopmail.com",

"yopmail.fr",

"yopmail.net",

"yuurok.com",

"zippymail.info",

"jnxjn.com",

"trashmailer.com",

"klzlk.com",

);

$email_split=explode('@',$email);

$email_domain=$email_split[1];

if(in_array($email_domain,$blacklist)){

//Return 1, disposable email detected

return1;

}

else{

//Return 0, no match found

return0;

}

}

?>

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:

PHP

1

"example.com",

So that the end of the list would look like:

1

2

3

4

5

"jnxjn.com",

"trashmailer.com",

"klzlk.com",

"example.com",

);

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.

PHP

1

2

3

4

5

6

7

8

<?php

if(disposablecheck($email)==1){

//do stuff for disposable emails

}

else{

//do stuff if not disposable email

}

?>

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.

PHP

1

2

3

4

5

6

<?php

if(disposablecheck($email)==1){

//Disposable email detected

wp_redirect('http://www.example.com/register');

}

?>

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.

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.

STORAGE :
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/

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
(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.

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.