PHPMailer: sending email .... asking for a receipt?

I'm going to create a script that will send an email. I am currently using PHPMailer. I was told that they would like an email to ask the user for a check, indicating that they are reading it. (like what you often see in the worldview). I don't know if this is possible. Can anyone tell me if this is possible and if so how to do it?

Thank!!

+2


source to share


5 answers


See $ ConfirmReadingTo in PHPMailer Documentation



( Newer PHPMailer link on gitHub )

+7


source


I'm not sure if you can use them in PHP or a quick search showed this:

Disposition-Notification-To: you@yourdomain.com

      



however, they are unreliable, as most email clients either ignore them or simply allow the user to delete "undo" to send a response. I've actually seen it used in enterprise / enterprise type env with Notes or Outlook.

Just something to consider, but depends on your application.

+4


source


In PHPMailer, you are using $ ConfirmReadingTo. You should set it equal to the email address you want to send confirmation to. Example:

$ConfirmReadingTo: you@yourdomain.com

      

But some email clients (like gmail) just ignore this.

The best way to get confirmation from every message sent is to send HTML email and use graphics to keep track of which emails have been opened. The graphical source will be a script that lets you check who read the email. Example:

<img src="http://www.yourSite.com/emailConfirm.php?FROM=someone@gmail.com&SUBJECT=The_Email_Subject" border="0" height="1" width="1">

      

emailConfirm.php can then create an email that will be sent to your email address.

+2


source


You can use Joshs recommendation with tracking image, but: - use special folder name and custom image name with .GIF extension - track this image request by php handler, as an exception, referring to this non-existing image - generate this custom image name in email letter

For example:

<img src="http://www.yourdomain.com/email/abc34642.gif">

      

Your php exception handler detects that you are requesting a gif image in the "email" folder, which means that someone opened your email with ID 34642. You have to find which recipient has that ID and you can find the information you need. I recommend using the generated XML file to avoid too many database queries. Don't forget to display a real image with a gif header. It is completely safe to block your email with the wrong image extension.

+1


source


I confirm that as of today, the correct method does:

$mail->addCustomHeader("Disposition-Notification-To: youremail@mail.com");

      

0


source