Read confirmation with PHPMAILER

依然范特西╮ 提交于 2019-12-10 22:09:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!