How to change the Return-path email address using the PHPMailer class

Written by Ian Carnaghan · 14 sec read >

Fill the $Sender property with the email address you wish to have as the Return-path 


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

This property can be found on Line 97 in the class.phpmailer.php file 

   * Sets the Sender email (Return-Path) of the message.  If not empty, 
   * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. 
   * @var string 
  public $Sender            = '';

Last Updated On March 22, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of