1、错误信息如下:
SMTP -> ERROR: Failed to connect to server: Permission denied (13)
2、解决方法:
https://gistpages.com/posts/phpmailer_smtp_error_failed_to_connect_to_server_permission_denied_13_fix
3、查看phpmailer状态
$ getsebool httpd_can_sendmail httpd_can_sendmail --> off $ getsebool httpd_can_network_connect httpd_can_network_connect --> off
4、以上可以看出,需要打开连接
$ setsebool -P httpd_can_sendmail 1 $ setsebool -P httpd_can_network_connect 1
本文介绍了当使用PHPMailer发送邮件遇到SMTP连接权限被拒错误时的解决方法。通过调整httpd_can_sendmail和httpd_can_network_connect设置,可以有效解决此问题。

被折叠的 条评论
为什么被折叠?



