Given an arbitrary address, Mailgun will validate the address based on:
Attaching to a form field:
$('jquery_selector').mailgun_validator({
api_key: 'api-key',
in_progress: in_progress_callback, // called when request is made to validator
success: success_callback, // called when validator has returned
error: validation_error, // called when an error reaching the validator has occured
});
Sample JSON in success callback:
{
"is_valid": true,
"parts": {
"local_part": "john.smith@example.com",
"domain": "example.com",
"display_name": ""
},
"address": "john.smith@example.com",
"did_you_mean": null
}
http://mailgun.github.io/validator-demo/