How to configure the Sender address in phpmailer library

1k views Asked by At

I'm not sure this question belongs to serverfaults. However I decided to post this here mainly because I am using php program to send emails.

My issue is to configuring the Sender part in phpmailer.

$mail->setFrom('[email protected]',"My Company Inc")
$mail->addReplyTo('[email protected]',"My Company Inc")

I put the above part in my code. But when I checked the receiver's end, I see the header

Sender: <[email protected]>

but what I expected to see is

Sender: <[email protected]>

I'm running own mailserver using exim MTA and dovecot.

Could you suggest me how to overcome this OR help me figure out whether this has to do with mailserver configuration.

1

There are 1 answers

5
zsram On

Maybe:

$mail->Sender = "[email protected]";

?