On this thread: How to detect if domain has catch all policy to accept email? Sachin Dane explains how to verify if a host behave like a "catch-all" domain using telnet.
I need to make this exact same verification but only using PHP, does anyone have this snippet somewhere ? or know the logic and functions to use to get this done ?
(I'm not looking for 3rd party services here, only the pure PHP solution)
Thanks a lot
I've tried to connect to SMTP host/port with fsockopen and then read some data using fgets in order to read the SMTP server response, but nothing shows up
<?php
$port = 465;
$host = "mail.gmx.com";
$hostip = @gethostbyname($host);
if ($handler = @fsockopen($hostip, $port, $errno, $errstr, 2)){
$buffer = fgets($handler, 50);//arbitrarily 50 bytes
echo $buffer;
}
?>
As a result my buffer stays always empty and i have no clue if this is even the right start.