duanqun9618
2012-06-29 02:20
浏览 139
已采纳

通过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
";

图片转代码服务由CSDN问答提供 功能建议

我通过PHP从我的服务器发送电子邮件> 后缀> Sendgrid。 在PHP中,我将From:标题设置为我的noreply@domain.com。 但是,电子邮件将始终在From标头中包含Apache@mail.domain.com。

从服务器发送电子邮件的新内容,我应该查看哪些配置文件? 或者我该如何调试呢?

我在PHP中设置这样的标题:

  $ headers =“From:”。  $ from。“
 
”; 
 $ headers =“Reply-To:”。$ from。“
 
”; 
 $ headers。=“MIME-Version:1.0 
 
”;  
 $ headers。=“Content-Type:text / html; charset = ISO-8859-1 
 
”; 
   
 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmi4734 2012-07-11 07:41
    已采纳

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

    点赞 打赏 评论

相关推荐 更多相似问题