Questions about fsockopen
Today when I was using fsockopen to write and send an email, I found a strange problem
Here is the code:
$fp=@fsockopen("smtp.163.com","25",$errno,$errstr);
if($fp){
echo "ok";
fclose($fp);
}else{
echo "error:".$errstr;
}
echo "
";
$fp=@fsockopen("www.163.com","80",$errno,$errstr);
if($fp){
echo "ok";
fclose($fp);
}else{
echo "error:".$errstr;
}
?>
Copy the code. The result of executing the above code on the US space is:
error:Connection refused
ok
The execution result in the home space is:
ok
ok
Because I’m a good person, I don’t dare to guess whether it’s because of the server or 163
I hope you guys can help me explain
Thank you
Let me answer