| 1 | <?php |
||
| 9 | { |
||
| 10 | $host = substr($emailAddress, strrpos($emailAddress, '@') + 1); |
||
| 11 | |||
| 12 | return $this->isHostValid($host); |
||
| 13 | } |
||
| 14 | |||
| 15 | public function isEmailFormatValid(string $emailAddress): bool |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Check DNS Records for MX type. |
||
| 27 | */ |
||
| 28 | private static function isMxValid(string $host): bool |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Check if one of MX, A or AAAA DNS RR exists. |
||
| 35 | */ |
||
| 36 | private function isHostValid(string $host): bool |
||
| 40 | } |
||
| 41 |