WordPress发邮件-在百度云虚拟主机BCH弹性web托管服务环境下

  • A+
所属分类:wordpress

弹性web托管需要通过fsockopen方式发信, 而Wordpress程序发送邮件是通过steam_connect_client而非fsockopen,所以需要修改程序配置文件/wp-include/class-smtpp.php,修改方法参考如下:

在网站文件中,找到 /wp-include/class-smtpp.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,$timeout);

亮享

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: