How to change envelope sender address using phpmailer?

前端 未结 4 1578
鱼传尺愫
鱼传尺愫 2020-12-10 19:08

With php mail() I can write

mail(\'to@example.com\',\'subject!\',\'body\',\'From: from@example.com\',\'-f from@example.com\');

But how can

4条回答
  •  暖寄归人
    2020-12-10 19:29

    The -f flag is set with $email->Sender

    This is the Envelope From which allows the email server to evaluate the sender's email address before receiving the rest of your email data

    SetFrom - this is what email address the end user will see as the message coming from

    AddReplyTo - this is what email address will pop up if they reply to the email

    Sender needs to be clean to pass spam filters

    SetFrom needs to be clean to pass spam filters

    AddReplyTo doesn't really matter. This allows a service to send an email on behalf of a user with an email address not managed by the service.

提交回复
热议问题