PHPMailer发送邮件出现Permission denied的解决办法
2016-08-29 11:26
525 查看
使用PHPMailer发送邮件,
可能会出现Permission denied错误, 如下:
2016-06-30 04:05:00 Connection: opening to smtp.exmail.qq.com:25, timeout=300, options=array ( ) 2016-06-30 04:05:04 SMTP ERROR: Failed to connect to server: Permission denied (13) 2016-06-30 04:05:04 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
这是因为selinux拒绝httpd服务发送邮件, 可以修改selinux的规则。 步骤如下:
1、使用下面的命令查看selinux的权限。
getsebool -a | grep httpd_can_sendmail
OR
getsebool httpd_can_sendmail
2、再使用下面的命令允许httpd发送邮件。
setsebool
-P httpd_can_sendmail 1
OR
/usr/sbin/setsebool-P httpd_can_sendmail
on
这样, 就能够正常发送邮件了。
相关文章推荐
- 【PHPmailer】发送邮件 出现无法连接服务器、函数 fsockopen()被禁用 解决办法 Subject 和 收件人重复
- 黄聪:PHP发送邮件出现Connection: opening to ssl://的解决办法
- 关于用javamail发送邮件时出现 PKIX path building failed异常 ,解决办法
- centos使用phpmailer发送邮件失败的解决办法
- wordpress之SMTP发送邮件出现Could not connect to SMTP host解决办法
- Godaddy服务器发送邮件出现Could not connect to SMTP host错误 解决办法
- PHPMailer发送邮件出现Permission denied的解决办法
- 发送激活邮件时出现java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream解决办法
- phpmailer在服务器上不能正常发送邮件的解决办法
- PHPMailer发送邮件出现Permission denied的解决办法
- JavaMail、Commons Email发送邮件 出现结果后到的文件是Base64的问题的解决办法
- PHP mail发送邮件出现问题的详细解决办法
- PHPmailer发送邮件时的常见问题及解决办法
- 服务器发送邮件出现Could not connect to SMTP host错误 解决办法
- 在服务器上用PHPMAIL发送邮件出现Could not connect to SMTP host错误 解决办法
- 关于发送邮件出现no smtp MX only错误的解决办法
- MaCfee导致Asp.net无法发送邮件的解决办法
- MaCfee导致Asp.net/Jmail无法发送邮件的解决办法
- 邮件发送的解决办法
- office2007" 向程序发送命令时出现问题 "的解决办法