Skip to content

Commit e5e7c33

Browse files
authored
Mailbox Verification added to return accurate validation result.
1 parent 03f6a25 commit e5e7c33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MailgunValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function queryMailgun($email)
3131
$curl = curl_init();
3232

3333
curl_setopt_array($curl, array(
34-
CURLOPT_URL => self::API_ENDPOINT . "?api_key=" . $this->apiKey . "&address=" . urlencode($email),
34+
CURLOPT_URL => self::API_ENDPOINT . "?api_key=" . $this->apiKey . "&address=" . urlencode($email) . '&mailbox_verification=true',
3535
CURLOPT_RETURNTRANSFER => true,
3636
CURLOPT_MAXREDIRS => 0,
3737
CURLOPT_TIMEOUT => 30,
@@ -58,7 +58,7 @@ private function queryMailgun($email)
5858
public function validate($email)
5959
{
6060
$ret = $this->queryMailgun($email);
61-
return $ret->is_valid;
61+
return $ret->is_valid === true && $ret->mailbox_verification !== false;
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)