Let's get down to practice
Let's look at the requests to api.testmail.top by examples. To try to send from a request to check a deliberately false domain/email, taken from one of the most popular temporary mail services temp-mail.org, from the console
curl --location --request GET 'https://firstname.lastname@example.org&ip=220.127.116.11' \
--header 'Authorization: Bearer XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXXX'
"message": "This domain is in Blacklist"
The response received
"result": false - which means that this user CANNOT be allowed to register
Now, let's try to send a request for domain/email verification using PHP. As in the previous example, there is nothing difficult, now, for example, let's send 100% GMAILtrust mail. On my own I recommend setting the CURLOPT_TIMEOUT parameter to 3 seconds, although a regular request takes a split second - this will protect your registration from crashing if the api.testmail.top server is unavailable
PHP - cURL request:
$curl = curl_init();
CURLOPT_URL => 'https://email@example.com&ip=18.104.22.168',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 3,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXXX'
$response = curl_exec($curl);
PHP - cURL response:
"message": "This domain is in Whitelist"
In response, we received
"result": true - this means that this user MAY be allowed to register