Email Checker Php -
function isSyntaxValid(string $email): bool
$domain = substr(strrchr($email, "@"), 1); $json = @file_get_contents("https://disposable.debounce.io/?domain=" . urlencode($domain)); if ($json) $data = json_decode($json, true); return isset($data['disposable']) && $data['disposable'] === 'true'; return false; // fallback email checker php
return $this->errors;
private array $errors = []; public function check(string $email): bool if ($json) $data = json_decode($json
$this->errors = []; // Level 1: Syntax if (!filter_var($email, FILTER_VALIDATE_EMAIL)) $this->errors[] = "Invalid email format"; return false; // Level 2: Domain exists $domain = substr(strrchr($email, "@"), 1); if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) $this->errors[] = "Domain does not accept email"; return false; // Level 3: Disposable check (optional – depends on your use case) if ($this->isDisposable($domain)) $this->errors[] = "Disposable email addresses not allowed"; return false; // Level 4: SMTP check (optional – use carefully) // if (!$this->smtpCheck($email)) // $this->errors[] = "Mailbox does not exist"; // return false; // return true; // fallback return $this->
$domain = substr(strrchr($email, "@"), 1); $freeProviders = [ 'gmail.com', 'yahoo.com', 'outlook.com', 'hotmail.com', 'aol.com', 'protonmail.com', 'mail.com', 'gmx.com' ]; return in_array($domain, $freeProviders);

