Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
$apikey="<PUT YOUR KEY HERE>";
* Make sure args are passed
if($argc!=2) {
print "Usage: ".$argv[0]."\n";
* Set up cURL
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FAILONERROR, false);
curl_setopt($c, CURLOPT_TIMEOUT, 5);
* Run cURL, parse info, and close it
* decode the JSON results
* Make sure you have a valid HTTP status code, and it parsed into the expected JSON object
if($info['http_code'] && isset($answer->email)) {
print "The email ".$argv[1]." has a status of: ".$answer->email->status."\n";
if($answer->email->status=="invalid") {
print "Address is invalid, encourage your user to correct his or her address\n";
} else {
print "Permit the user through\n";
} else {
print "Could not talk to BV servers - allow the address through as 'unknown'\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.