About fsockopen. When I used fsockopen to write an email, I found a strange problem: $ fp @ fsockopen (smtp.163.com, 25, $ errno, $ errstr ); if ($ fp) {echook questions about fsockopen
I found a strange problem when I wrote an email using fsockopen today.
The following code is used:
$ 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;
}
?>
The execution result of the above code in the U.S. space is:
Error: Connection refused
OK
The execution result in the local space is:
OK
OK
Because I am very fond of food, I dare not guess the reason is the server or 163.
I hope you can explain it to me.
Thank you.
Let me answer
Parse found a strange problem when using fsockopen to write an email today: $ fp = @ fsockopen ("smtp.163.com", "25", $ errno, $ errstr ); if ($ fp) {echo "OK...