File tree 2 files changed +16
-19
lines changed
2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -31,20 +31,17 @@ Example Use Case
31
31
32
32
echo var_dump($validator->validateExtended('someuser@ymail.com'));
33
33
34
- // object(stdClass)#2 (4) {
35
- // ["address"]=>
36
- // string(19) "someuser@ymail.com"
37
- // ["did_you_mean"]=>
38
- // NULL
39
- // ["is_valid"]=>
40
- // bool(true)
41
- // ["parts"]=>
42
- // object(stdClass)#4 (3) {
43
- // ["display_name"]=>
44
- // NULL
45
- // ["domain"]=>
46
- // string(10) "ymail.com"
47
- // ["local_part"]=>
48
- // string(8) "someuser"
49
- // }
50
- // }
34
+ object(stdClass)#207 (8) {
35
+ ["address"]=> string(18) "someuser@ymail.com"
36
+ ["did_you_mean"]=> NULL
37
+ ["is_disposable_address"]=> bool(false)
38
+ ["is_role_address"]=> bool(false)
39
+ ["is_valid"]=> bool(true)
40
+ ["mailbox_verification"]=> string(4) "true"
41
+ ["parts"]=> object(stdClass)#208 (3) {
42
+ ["display_name"]=> NULL
43
+ ["domain"]=> string(9) "ymail.com"
44
+ ["local_part"]=> string(8) "someuser"
45
+ }
46
+ ["reason"]=> NULL
47
+ }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ private function queryMailgun($email)
31
31
$ curl = curl_init ();
32
32
33
33
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 ' ,
35
35
CURLOPT_RETURNTRANSFER => true ,
36
36
CURLOPT_MAXREDIRS => 0 ,
37
37
CURLOPT_TIMEOUT => 30 ,
@@ -58,7 +58,7 @@ private function queryMailgun($email)
58
58
public function validate ($ email )
59
59
{
60
60
$ ret = $ this ->queryMailgun ($ email );
61
- return $ ret ->is_valid ;
61
+ return $ ret ->is_valid === true && $ ret -> mailbox_verification !== false ;
62
62
}
63
63
64
64
/**
You can’t perform that action at this time.
0 commit comments