@DeBounceEmail/

PHP DeBounce Email Validation API

PHP (Legacy)

PHP sample code of Real-time email validation using DeBounce.io API.

fork
loading
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$API_KEY = 'YOUR_API_KEY_HERE';
$email = '[email protected]';

$data = file_get_contents('https://api.debounce.io/v1/?api='.$API_KEY.'&email='.$email);
$response = json_decode($data, true);

// Uncomment below line to see full API response.
// var_dump($response);

$error = $response['debounce']['error'];
$validation_result = $response['debounce']['send_transactional'];

if($error!=''){
    echo 'Error: '.$error;
}elseif($validation_result=='1'){
    echo 'You can send transactional emails to '.$email;
}else{
    echo 'You cannot send transactional emails to '.$email;
}
?>
PHP 7.0.8 (Legacy: use the following for new features: Command-line PHP: https://repl.it/languages/php_cli PHP Web Server: https://repl.it/languages/php7