通过postfix + PHP以Apache用户身份发送电子邮件

I am sending emails from my server via PHP > postfix > Sendgrid. In PHP, I set the From: header to my noreply@domain.com. However, the email will always have Apache@mail.domain.com in the From header.

New to sending emails from the server, what configuration files should I look at? Or how can I debug this?

I am setting the headers like this in PHP:

$headers = "From: ".$from."
";
$headers = "Reply-To: ".$from."
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/html; charset=ISO-8859-1
";

The problem was that one of the $headers .= lines didn't have a .= and was overwriting the previous headers. Easy to miss I guess.