1.用FTP打开 /wp-include/class-smtp.php ,最好是下载下来,搜索一下,查找到如下的代码:

 

$this->smtp_conn = @stream_socket_client(

$host . ":" . $port,

$errno,

$errstr,

$timeout,

STREAM_CLIENT_CONNECT,

$socket_context

);

注释掉,然后添加代码:

$this->smtp_conn = fsockopen($host, $port, $errno, $errstr);

 

2、如果是PHP5.6.X的版本,那么可能会有报错:

SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 

PHP5.6会默认开启SSL验证,所以需要

在php.ini中增加一行

1

openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt

  

重启服务器使修改生效

查看原文