Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the Return-path using PHPMailer

Tags:

php

phpmailer

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?

like image 514
Elitmiar Avatar asked Aug 12 '10 12:08

Elitmiar


People also ask

Is PHPMailer SMTP?

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.

How can I send multiple emails in PHPMailer?

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.


1 Answers

The following solved the issue, I adjusted the Sender property and it worked for me. $mail->Sender = '[email protected]';

like image 85
Elitmiar Avatar answered Oct 10 '22 00:10

Elitmiar