Title: Mailgun Email Validator
Author: Jesin A
Published: <strong>October 5, 2013</strong>
Last modified: November 25, 2017

---

Search plugins

![](https://ps.w.org/mailgun-email-validator/assets/banner-772x250.png?rev=1057422)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/mailgun-email-validator_777777.svg)

# Mailgun Email Validator

 By [Jesin A](https://profiles.wordpress.org/jesin/)

[Download](https://downloads.wordpress.org/plugin/mailgun-email-validator.1.2.4.1.zip)

 * [Details](https://wordpress.org/plugins/mailgun-email-validator/#description)
 * [Reviews](https://wordpress.org/plugins/mailgun-email-validator/#reviews)
 *  [Installation](https://wordpress.org/plugins/mailgun-email-validator/#installation)
 * [Development](https://wordpress.org/plugins/mailgun-email-validator/#developers)

 [Support](https://wordpress.org/support/plugin/mailgun-email-validator/)

## Description

Most email validators look for an `@` and a `.`(dot) some go further and blacklist
certain domain names. But Mailgun’s Advanced email validation service goes deeper
and looks for the existence of the domain name, presence of a [MX record](http://en.wikipedia.org/wiki/MX_record)
and the custom ESP(Email Service Provider) grammar.
 The grammar here is the rules
defined by each email provider. For example, Yahoo Mail addresses can only contain
letters, numbers, underscores, and one period. So `user.name.abc@yahoo.com` perfectly
passes the [is_email()](https://codex.wordpress.org/Function_Reference/is_email)
function but can never exist as it contains more than one period. Such addresses
can’t escape Mailgun’s Email validation.

#### Why use Mailgun’s email validation service?

 * Performs the usual email syntax check.
 * Checks the existence of the email domain. So `user@some-random-characters.com`
   can’t escape.
 * Checks if the email domain has a MX record. So `anything@example.com` is caught.
 * Checks if the username complies with the grammar of its ESP (Email Service provider).
   Eg Gmail doesn’t allow usernames less than 6 characters and hyphens so `small@gmail.
   com` and `hyphen-user@gmail.com` can’t get away.

#### Why use this plugin?

 * Integrates with the [is_email()](https://codex.wordpress.org/Function_Reference/is_email)
   function of WordPress. So it works seamlessly with Contact Form 7, Jetpack/Grunion
   contact forms, WordPress registration form and any form which uses the `is_email()`
   function.
 * Kicks spam before it is inserted into the database
 * Ensures that the commenting process is uninterrupted even if Mailgun suffers 
   a [downtime](http://status.mailgun.com)
 * Works completely transparent, nothing changes in the frontend

This plugin requires a Mailgun Public API Key which can be obtained by [signing up at Mailgun](https://mailgun.com/signup).

If you’re trying out this plugin on a local WAMP/LAMP/MAMP installation make sure
your system is connected to the Internet for this plugin to contact Mailgun.

#### Available Languages

 * English
 * Serbo-Croatian by [Borisa Djuraskovic](http://www.webhostinghub.com/)
 * Spanish by [Andrew Kurtis](http://www.webhostinghub.com/)

#### Further Reading

Read about Mailgun’s email validation service.

 * [http://blog.mailgun.com/post/free-email-validation-api-for-web-forms/](http://blog.mailgun.com/post/free-email-validation-api-for-web-forms/)
 * [http://blog.mailgun.com/post/weekly-product-update-improvements-to-email-validation-api/](http://blog.mailgun.com/post/weekly-product-update-improvements-to-email-validation-api/)
 * [Mailgun Address Validator demo](http://mailgun.github.io/validator-demo/) and
   its [source code](https://github.com/mailgun/validator-demo/tree/gh-pages)
 * The [Mailgun Email Validator Plugin](https://websistent.com/wordpress-plugins/mailgun-email-validator/)
   official homepage.

## Screenshots

 * [[
 * Enter your public API key to begin validation.
 * [[
 * A comment with an incorrect email address.
 * [[
 * This plugin in action on the user registration page.
 * [[
 * Email validation in a contact form.

## Installation

 1. Unzip and upload the `mailgun-email-validator` folder to the `/wp-content/plugins/`
    directory.
 2. Activate the **Mailgun Email Validator** plugin through the ‘Plugins’ menu in WordPress.
 3. Configure the plugin by going to `General > Email Validation` page.
 4. [Signup](https://mailgun.com/signup) for a Mailgun account (First 100 validations
    are free every month).
 5. [Login](https://mailgun.com/sessions/new), copy and paste your public API key to`
    General > Email Validation` page.

## FAQ

  Installation Instructions

 1. Unzip and upload the `mailgun-email-validator` folder to the `/wp-content/plugins/`
    directory.
 2. Activate the **Mailgun Email Validator** plugin through the ‘Plugins’ menu in WordPress.
 3. Configure the plugin by going to `General > Email Validation` page.
 4. [Signup](https://mailgun.com/signup) for a Mailgun account (First 100 validations
    are free every month).
 5. [Login](https://mailgun.com/sessions/new), copy and paste your public API key to`
    General > Email Validation` page.

  Why did you create this plugin?

I hate comment spam because it bloats my database. I also don’t like bugging my 
visitors with CAPTCHAs in the form of scribbled text,
 counting the puppies and 
answering questions like _What is 3 + 2?_ So when Mailgun released their email validation
service I tried validating the email addresses of comments in the spam queue of 
[my blog](https://websistent.com). I found that nearly 50% of these email addresses
were identified incorrect by Mailgun. Thus this plugin was born. Though not as effective
as CAPTCHAs this plugin can prevent a decent amount of spam while maintaining user
experience.

  Is this plugin a product of Mailgun?

No. It only makes use of Mailgun’s email validation service API. Nothing in the 
code belongs to Mailgun.

  I get a *401 Unauthorized* error when I verify the API key but I’m very sure that
it is correct

You could be using the normal API key, for this plugin you need to enter the **Public
API Key** this is slightly
 longer than the normal API key and is found just below
it.

  This plugin is active and I have entered a Valid Public API Key but it doesn’t
work

Try the email validation demo from the plugin’s option page. It could a connectivity
issue.

  What happens if Mailgun’s service is down?

In such cases emails are passed on untouched (as though this plugin is nonexistent)
and on the front-end users won’t notice anything.

  What contact form plugins are supported?

Any form which uses the `is_email()` function are supported this means the most 
popular ones like Contact Form 7, Jetpack by WordPress.com, Grunion Contact Form

and a lot of others are supported.

  Does Mailgun support this plugin?

No, because Mailgun didn’t create it. If you need support create a thread
 by choosing
the **Support** tab of this plugin. If you directly create a thread in the forum
I’ll never know of its existence.

  I want to see a demo of emails validating

Mailgun has created a [jquery demo](http://mailgun.github.io/validator-demo/) at
this page. The code for this demo is [available here](https://github.com/mailgun/validator-demo/tree/gh-pages).

## Reviews

![](https://secure.gravatar.com/avatar/3a15bc0e1c55ce1950351777a2a5d2f51a01cc09461251d0afcd0e670aee0fc5?
s=60&d=retro&r=g)

### 󠀁[400k+ validations with 220k sessions?! UH…](https://wordpress.org/support/topic/400k-validations-with-220k-sessions-uh/)󠁿

 [sashen](https://profiles.wordpress.org/sashen/) October 8, 2017 1 reply

I’m using Mailgun with the Woocommerce plugin. In the first month of paid service,
Mailgun reports that we had over 416,000 validations and charged me over $2,000!
Uh… we only had 220k VISITORS to our site, and only 13k to our checkout page. Mailgun
conceded that they’re validating emails that Woo sends to our own domain (order 
validations), and suggested that *something* is causing multiple validations. I 
can’t see how that would get us to 400k+ and they’ve provided NO transparency, no
ability to audit their data, no way to modify their service to address whatever 
the problems are, and NO offer to give any credit for problems that, frankly, they
could have anticipated before the switch to a paid service by looking up the number
of validations we had PRIOR to their switch to paid (I spoke with a sales rep prior
to deciding so continue using Mailgun after their switch). Buyer beware!

![](https://secure.gravatar.com/avatar/0e1f76994a040ca1ac19e6256c44544ef03d183a57bb4dadb6db92395cfdc8e3?
s=60&d=retro&r=g)

### 󠀁[Beware! MailGun email validation is now being charged](https://wordpress.org/support/topic/beware-mailgun-email-validation-key-is-being-leaked/)󠁿

 [envieme](https://profiles.wordpress.org/envieme/) August 17, 2017 2 replies

Suddenly this month my mailgun email validation bill ran into thousands of dollars.
And am not kidding! After a quick check with the plugin author, we figured spammers
have been using the comments form where email was getting validated. And thousands
of validations caused the bill as from June 27 Mailgun has been charging for validation.
Am sure a lot more users using this plugin is going to face charges from mailgun.
To prevent further charges please set limit for validations in your account settings
to less than 100. But the issue is this plugin becomes invalid with wordpress spammers
sure to use up that limit.

![](https://secure.gravatar.com/avatar/75c5bc1412ca123b068f46d7b4cc04363d8f22c330b85621009a25356c778614?
s=60&d=retro&r=g)

### 󠀁[Excellent!](https://wordpress.org/support/topic/excellent-4957/)󠁿

 [dabodude](https://profiles.wordpress.org/dabodude/) May 31, 2017

Wow, this has to be one of the best yet simple plugins I have used…

![](https://secure.gravatar.com/avatar/1b355cc6367117965e6e3fdef6be3bbe60ff621a44bfb24a75c5bfca7cbd2129?
s=60&d=retro&r=g)

### 󠀁[Works perfectly](https://wordpress.org/support/topic/works-perfectly-1141/)󠁿

 [Robert Sim](https://profiles.wordpress.org/robertsky_/) April 17, 2017

Implementing this plugin is straight forward and simple.

![](https://secure.gravatar.com/avatar/34b4325cc5f253b04cfe16f7db6f3c622ef4b29dd4328c439b443658e9431a67?
s=60&d=retro&r=g)

### 󠀁[Hard to get started…](https://wordpress.org/support/topic/hard-to-get-started/)󠁿

 [hartmutnz](https://profiles.wordpress.org/hartmutnz/) December 18, 2016 2 replies

I needed a quick fix, so signed up, installed the plugin. Now the work starts: Then
I am asked for email verification and registration…. bla,bla, done that.. THEN I
get another popup: Enter your Phone Number… bla,bla.. for TXT verification.. sorry,
this is TOO TIGHT, whats wrong just going through my email? Also, If you enter a
domain on their account panel, it will ask you to … go to the registrar… enter DNS
records etc… another job I don’t wanna do, got enough on my plate

![](https://secure.gravatar.com/avatar/5c5499f01f95429ff1e28db999fdbecea83a0d7360b340c0faa86372c0374583?
s=60&d=retro&r=g)

### 󠀁[Shoot it down](https://wordpress.org/support/topic/shoot-it-down/)󠁿

 [phablutzel](https://profiles.wordpress.org/phablutzel/) September 25, 2016 3 replies

Went for trial and was locked out before could even use. After a simple mailbox 
check to verify existence, if not restrict form completion. Usually, if you start
off with issues, the rest follows, so abandoned as locking out users and requesting
contact support before you start is a joke. Never put a bad or good comment on WordPress
yet, but this deserves one and one star rating as well.

 [ Read all 26 reviews ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/)

## Contributors & Developers

“Mailgun Email Validator” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Jesin A ](https://profiles.wordpress.org/jesin/)

[Translate “Mailgun Email Validator” into your language.](https://translate.wordpress.org/projects/wp-plugins/mailgun-email-validator)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/mailgun-email-validator/),
check out the [SVN repository](https://plugins.svn.wordpress.org/mailgun-email-validator/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/mailgun-email-validator/)
by [RSS](https://plugins.trac.wordpress.org/log/mailgun-email-validator/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.2.4.1

 * 19th October 2017
 * Add global variables $pagenow and $wp

#### 1.2.4

 * 8th October 2017
 * Don’t use Mailgun validation on the WooCommerce WP-Admin orders page. [More details…](https://wordpress.org/support/topic/is_email-function-happens-a-lot/)

#### 1.2.3

 * 16th October 2016
 * Removed PHP4 style constructors for PHP 7 compatibility

#### 1.2.2

 * 21st April 2015
 * Use [Mailgun’s API v3](http://blog.mailgun.com/default-api-version-now-v3/)
 * Added Spanish language, props [Andrew Kurtis](http://www.webhostinghub.com/)

#### 1.2.1

 * 19th October 2014
 * Use HTTP HEAD instead of GET to validate API key. [More details…](https://wordpress.org/support/topic/a-http-error-occurred-when-validating-the-api-error-code-502-bad-gateway)

#### 1.2

 * 3rd September 2014
 * Added Serbo-Croatian language, props [Borisa Djuraskovic](http://www.webhostinghub.com/)

#### 1.1

 * 3rd November 2013
 * Plugin is translation ready

#### 1.0

 * 5th October 2013
 * Initial version

## Meta

 *  Version **1.2.4.1**
 *  Last updated **8 years ago**
 *  Active installations **60+**
 *  WordPress version ** 3.1.0 or higher **
 *  Tested up to **4.9.29**
 * Tags
 * [anti-spam](https://wordpress.org/plugins/tags/anti-spam/)[comments](https://wordpress.org/plugins/tags/comments/)
   [email validation](https://wordpress.org/plugins/tags/email-validation/)[spam](https://wordpress.org/plugins/tags/spam/)
   [validation](https://wordpress.org/plugins/tags/validation/)
 *  [Advanced View](https://wordpress.org/plugins/mailgun-email-validator/advanced/)

## Ratings

 4.1 out of 5 stars.

 *  [  18 5-star reviews     ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/?filter=3)
 *  [  1 2-star review     ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/?filter=2)
 *  [  4 1-star reviews     ](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/mailgun-email-validator/reviews/)

## Contributors

 *   [ Jesin A ](https://profiles.wordpress.org/jesin/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/mailgun-email-validator/)