我正在通过 PHP > postfix > Sendgrid 从我的服务器发送电子邮件。在 PHP 中,我将 From: header 设置为我的 noreply@domain.com。但是,电子邮件的发件人 header 中始终包含 Apache@mail.domain.com。
从服务器发送电子邮件的新手,我应该查看哪些配置文件?或者我该如何调试?
我在 PHP 中这样设置 header :
$headers = "From: ".$from."\r\n";
$headers = "Reply-To: ".$from."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
最佳答案
问题是其中一个 $headers .= 行没有 .= 并且正在覆盖以前的标题。我想很容易错过。
关于php - 通过 postfix + PHP 以 Apache 用户身份发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11255281/