我正在编写一个 PHP 服务器备份脚本,如果发生错误,它会向我发送电子邮件。现在我有以下代码:
if (mail("[email protected]", "ERRRORRSSSS", "hello:)")) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
当我在命令行上运行它时,我收到“消息已成功发送”消息,但我的邮箱(或垃圾邮件文件夹)中没有任何内容
这里还有更多信息...
php -i |grep mail
mail.force_extra_parameters => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
Path to sendmail => /usr/sbin/sendmail -t -i
MAIL => /var/spool/mail/root
_SERVER["MAIL"] => /var/spool/mail/root
_ENV["MAIL"] => /var/spool/mail/root
有任何想法吗??