Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read confirmation with PHPMAILER

I try to return a reading confirmation when send an email with PHPMAILER but it doesn't works :(

I tried these options :

Construction of the object:

$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->From = '[email protected]';
$mail->FromName = 'Nom Prénom';
$mail->addAddress($Desti);
$mail->addCC($CC);
$mail->addBCC($BCC);
$mail->isHTML(true);
$mail->Subject = 'MON SUJET';
$mail->Body = $MonTexteMail;

first solution :

$mail->AddCustomHeader( 'X-pmrqc: 1' );
$mail->AddCustomHeader( "X-Confirm-Reading-To: [email protected]" );

Second solution

$mail->AddCustomHeader( "Return-receipt-to: [email protected]" );

third solution

$mail->AddCustomHeader( "Disposition-Notification-To:<[email protected]>");

Fourth solution

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

But nothing works,

like image 215
kikilevrai Avatar asked Oct 15 '25 16:10

kikilevrai


2 Answers

$mail->AddCustomHeader( "X-Confirm-Reading-To: [email protected]" );

$mail->AddCustomHeader( "Return-receipt-to: [email protected]" );

This works, Outlook/Gmail/Thunderbird detects it and requests confirm, I used it today for a little script.

like image 190
Newtron Avatar answered Oct 17 '25 05:10

Newtron


I found that capitalization is important to some email client programs. Also some use Disposition-Notification-To. This is what I reccommend:

$mail->AddCustomHeader( "X-Confirm-Reading-To: $eUser" );
$mail->AddCustomHeader( "Return-Receipt-To: $eUser" );
$mail->AddCustomHeader( "Disposition-Notification-To: $eUser" );
like image 26
Peter Brand Avatar answered Oct 17 '25 07:10

Peter Brand