Created
September 29, 2022 11:40
-
-
Save websterl3o/bc80780c9de868fa1bab4e5717a94e46 to your computer and use it in GitHub Desktop.
Integração com EmailListVerify/Integration with EmailListVerify - PT-BR Esse código é um teste de integração com o EmailListVerify, onde ele verifica o e-mail e retorna se ele é valido. - EN This code is an integration test with EmailListVerify, where it checks the email and returns if it is valid.
This file contains 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 | |
try { | |
$listResults = [ | |
'ok', // All is OK. The server is saying that it is ready to receive a letter to,this address, and no tricks have been detected | |
'error', // The server is saying that delivery failed, but no information about,the email exists | |
'smtp_error', // The SMTP answer from the server is invalid or the destination server,reported an internal error to us | |
'smtp_protocol', // The destination server allowed us to connect but the SMTP,session was closed before the email was verified | |
'unknown_email', // The server said that the delivery failed and that the email address does,not exist | |
'attempt_rejected', // The delivery failed; the reason is similar to “rejected” | |
'relay_error', // The delivery failed because a relaying problem took place | |
'antispam_system', // Some anti-spam technology is blocking the,verification progress | |
'email_disabled', // The email account is suspended, disabled, or limited and can not,receive emails | |
'domain_error', // The email server for the whole domain is not installed or is,incorrect, so no emails are deliverable | |
'ok_for_all', // The email server is saying that it is ready to accept letters,to any email address | |
'dead_server', // The email server is dead, and no connection to it could be established | |
'syntax_error', // There is a syntax error in the email address | |
'unknown', // The email delivery failed, but no reason was given | |
'accept_all', // The server is set to accept all emails at a specific domain.,These domains accept any email you send to them | |
'disposable', // The email is a temporary address to receive letters and expires,after certain time period | |
'spamtrap', // The email address is maintained by an ISP or a third party,which neither clicks nor opens emails | |
]; | |
$email = 'derpino17@gmail.com'; // ok | |
$email = 'matheus@gmail.com'; // email_disabled | |
$email = 'soreca5415@ploneix.com'; // ok | |
$key = 'wuYuiFlB4IdzG1alPavA4FF'; | |
$url = 'https://apps.emaillistverify.com/api/verifyEmail?secret='.$key.'&email='.$email; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
$response = curl_exec($ch); | |
echo $response; | |
curl_close($ch); | |
} catch (Exception $e) { | |
echo 'Exception when calling'.PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PT-BR
Durante os testes constatei algumas falhas, quando criei um e-mail temporário ele não conseguiu reconhecer e retornou um "ok".
EN
During the tests I found some failures, when I created a temporary email he could not recognize and returned an "ok".