Is there a way to change the return-path using PHPMailer
I did the following and it did not work
$mail->AddCustomHeader('Return-path:[email protected]');
I'm using the following statement to send mails
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
//Building the reporting email to report on all the mails send
echo "Message REPORT sent!\n";
}
I get the email but the return path does not change?
PHPMailer can use a non-local mail server (SMTP) if you have authentication. Further advantages include: It can print various kinds of error messages in more than 40 languages when it fails to send an email. It has integrated SMTP protocol support and authentication over SSL and TLS.
You have to create a completely different PHPMailer object for the second email, or you could just use AddAddress to send the same email to multiple addresses. If you don't want the senders to see each other, use BCC.
The following solved the issue, I adjusted the Sender property and it worked for me. $mail->Sender = '[email protected]';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With