Last active
August 20, 2018 17:03
-
-
Save pontikis/82b63ece1bfde300f4778ad1beecd3bb to your computer and use it in GitHub Desktop.
Email validation with Mailgun and php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* https://documentation.mailgun.com/en/latest/user_manual.html#email-validation. | |
*/ | |
use Mailgun\Mailgun; | |
$mgClient = new Mailgun('YOUR_PUBLIC_API_KEY'); | |
$responce = $mgClient->get('address/validate', | |
[ | |
'address' => '[email protected]', | |
'mailbox_verification' => true, // or false if you prefer | |
] | |
); | |
$is_valid = $responce->http_response_body->is_valid; | |
// to view the whole response | |
echo var_export(get_object_vars($responce), true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment