Because PHP's native fsockopen implementation is lengthy, most developers use a library like egulias/email-validator .
This is the most thorough method. It involves connecting to the mail server and asking if a specific user exists. This is complex, slow, and often blocked by major email providers (like Gmail/Outlook) to prevent email harvesting. check email valid php
return true;
?>