Email delivery (or Mailbox) testing without sending emails in PHP?

68 Views Asked by At

I have a list of emails and want to check how many of them are able to receive emails.

I have a PHP code that validates email using

filter_var($email, FILTER_VALIDATE_EMAIL)

and

$domain = explode('@', $email)[1];
if (!checkdnsrr($domain, 'MX')) {
    return "Domain does not exist or has no MX record";
}

But when I check the email [email protected], it returns no errors. However the mailbox f34f34f34fh34hfh3fhh4hf does not exist. So sending any emails to this address won't be delivered.

I want to check if the mailbox f34f34f34fh34hfh3fhh4hf exists for the domain $domain before sending email - without actually sending any emails.

Is it possible with PHP/PHPMailer/SMTP?

A service is doing it already: https://verifalia.com/validate-email

I tried basic validations, but I require a more in-depth email delivery testing approach. First of all to make sure the domain exists and as well as that to ensure the specific mailbox exists.

0

There are 0 best solutions below