简体   繁体   English

如何在phpmailer库中配置发件人地址

[英]How to configure the Sender address in phpmailer library

I'm not sure this question belongs to serverfaults . 我不确定这个问题是否属于serverfaults However I decided to post this here mainly because I am using php program to send emails. 但是,我决定将其发布在这里主要是因为我正在使用php程序发送电子邮件。

My issue is to configuring the Sender part in phpmailer. 我的问题是在phpmailer中配置发件人部分。

$mail->setFrom('info@mydomain.com',"My Company Inc")
$mail->addReplyTo('info@mydomain.com',"My Company Inc")

I put the above part in my code. 我把上面的部分放在我的代码中。 But when I checked the receiver's end, I see the header 但是当我检查接收器的末端时,我看到了标题

Sender: <mydomain@mydomain.com>

but what I expected to see is 但是我期望看到的是

Sender: <info@mydomain.com>

I'm running own mailserver using exim MTA and dovecot. 我正在使用exim MTA和dovecot运行自己的邮件服务器。

Could you suggest me how to overcome this OR help me figure out whether this has to do with mailserver configuration. 您能否建议我如何克服此问题,还是可以帮助我弄清楚这是否与邮件服务器配置有关。

Maybe: 也许:

$mail->Sender = "info@mydomain.com";

?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM