Fsockopen sends mail

fsockopen("smtp.163.com", 25, "", "", 10);
false,
FSOCKOPENfalse
Php
Mar.30,2021

generally closes port 25. You need to ask your service provider whether port 25 is open


$handler = fsockopen('smtp.163.com', 26, $errcode, $errmsg, 10);
var_dump($errcode, $errmsg, $handler);

pfsockopen-Open a persistent network connection or Unix socket connection.

resource fsockopen (string $hostname [, int $port =-1 [, int & $errno [, string & $errstr [, float $timeout = ini_get ("default_socket_timeout")])

as you can see from the document, int & $errno and string & $errstr are reference types and cannot be assigned directly.

the result of execution in PHP 5.6 / PHP 7.1.16 (cli) is as follows

Fatal error: Only variables can be passed by reference in xxx.php on line 2

the modified code is as follows

<?php
$res = fsockopen('smtp.163.com', 25, $errno, $errmsg, 10);

var_dump($errno, $errmsg);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3616a-2bff1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3616a-2bff1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?