PHP不发送邮件,sendmail工作正常

PHP不发送邮件,sendmail工作正常,php,email,amazon-web-services,sendmail,Php,Email,Amazon Web Services,Sendmail,这件事让我大吃一惊 我知道sendmail配置正确,因为: sendmail -s "test" example@gmail.com test 使用正确的反向域等正确发送邮件 但是,此脚本: <?php $to='dest@domain.com'; $what='Mail Test'; $body="Can this body be read? on ".date('l jS \of F Y h:i:s A'); $header="Content-type: text/html; cha

这件事让我大吃一惊

我知道sendmail配置正确,因为:

sendmail -s "test" example@gmail.com
test
使用正确的反向域等正确发送邮件

但是,此脚本:

<?php
$to='dest@domain.com';
$what='Mail Test';
$body="Can this body be read? on ".date('l jS \of F Y h:i:s A');
$header="Content-type: text/html; charset=iso-8859-1\r\nFrom:Blackhole<blackhole@domain.com>\r\n";
if(mail($to,$what,$body,$header)) $message="This just sent an email to $to .";
else $message="The email FAILED to send here to $to";
?>
<p><?php echo $message; ?></p>
我在配置中遇到的唯一错误是生成sendmail.cf时出现
错误
m4:/etc/mail/sendmail.mc:108:警告:文件结尾被视为换行符

但是,恢复此操作不会导致邮件重新开始工作


在亚马逊AWS实例上的Ubuntu服务器上运行。

那么您会遇到什么错误呢?在我的php或apache错误日志中没有显示任何错误,令人震惊(wordpress
debug.log
)。我甚至创建了其中几个的新空白版本来确保。邮件服务器日志是您要检查的地方啊!谢谢我们的邮件服务器由Godaddy处理,所以我向其中一封邮件发送了一封电子邮件,它返回了“用户uknown”。如果它不是映射到的域,它就可以工作。有没有办法强迫sendmail实际执行整个SMTP过程,即使理论上它是“这些”用户之一?
MASQUERADE_AS(domain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(domain.com)
define(`confDOMAIN_NAME', `domain.com')dnl