So, the thing is I was working on the application in which I need to check that the email id is currently active or in working state or not, for which I used fsockopen()
function of PHP, now what happens is in my localhost XAMPP its working fine but when I uploaded it to the server bigrock it is giving an error as:
Message: fsockopen(): unable to connect to ssl://gmail-smtp-in.l.google.com:465 (Connection timed out)
My code is.
function email_validation($email){
list($name, $domain)=explode('@',$email);
$max_conn_time = 30;
$sock='';
$port = 25;
$max_read_time = 5;
$users=$name;
$hosts = array();
$mxweights = array();
getmxrr($domain, $hosts, $mxweights);
$mxs = array_combine($hosts, $mxweights);
asort($mxs, SORT_NUMERIC);
$mxs[$domain] = 100;
$timeout = $max_conn_time / count($mxs);
while(list($host) = each($mxs)){
$host="ssl://".$host;
if($sock = fsockopen($host, 465, $errno, $errstr, 10)){
stream_set_timeout($sock, $max_read_time);
break;
}
}
}