问题
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 = 'prenom.nom@mail.com';
$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: mail.confirm@domain.com" );
Second solution
$mail->AddCustomHeader( "Return-receipt-to: mail.confirm@domain.com" );
third solution
$mail->AddCustomHeader( "Disposition-Notification-To:<mail.confirm@domain.com>");
Fourth solution
$mail->ConfirmReadingTo = "mail.confirm@domain.com";
But nothing works,
回答1:
$mail->AddCustomHeader( "X-Confirm-Reading-To: your@email.com" );
$mail->AddCustomHeader( "Return-receipt-to: your@email.com" );
This works, Outlook/Gmail/Thunderbird detects it and requests confirm, I used it today for a little script.
回答2:
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" );
回答3:
The read receipt email will send to the email address you provide:
$mail->ConfirmReadingTo = "email@address.com";
来源:https://stackoverflow.com/questions/28609156/read-confirmation-with-phpmailer