Categories
WordPress

WordPress 无法发送邮件

发送邮件失败

centos
lnmp 1.2.0
wordpress 4.2.4
contact-form 无法发送邮件

原因是 sendmail 没有被安装

yum install sendmail
service sendmail start
locate sendmail 查看 sendmail 所在的目录
/usr/sbin/sendmail 不出意外会看到,也就安装好了

vi /usr/local/php/etc/php.ini 编辑 php 设置文件
?sendmail_path
sendmail_path = /usr/sbin/sendmail -t -i 修改为这样,绝对路径
lnmp restart 重启 lnmp

done

参考:

LNMP的mail函数不能发送邮件解决办法

LNMP笔记:解决mail函数不能发送邮件

Leave a Reply

Your email address will not be published. Required fields are marked *