How do I know if the email has reached the Recipient?

4

I'm building a (in PHP) system that needs approvals, and with each approval I send a confirmation email to the user ...

I'm using phpMailler , and he informs me in the end that the server sent the email ..

But I wanted to know (be sure) if the email reached the recipient, how?

I did several searches on the internet but so far I have not found anything ... thank you in advance for all help

    
asked by anonymous 30.10.2014 / 20:01

1 answer

1

There is a possible solution that can help you.

Assuming you record in the database all submissions that are made, in a envios table that contains, for example:

+--------+--------+
|idEnvio | status |
+--------+--------+
|     15 |      0 |
|     16 |      1 |
|     17 |      2 |
+--------+--------+

Where 0 = E-mail waiting to be sent, 1 = E-mail sent, 2 = E-mail read

On your server, create a page that receives the message to change in the database, for example:

alteraStatus.php

<?php

    $idEnvio = $_GET["idEnvio"];

    mysql_query("UPDATE envios SET status = 2 WHERE idEnvio = {$idEnvio}");

?>

In the body of your email, insert an image pointing to this page, for example:

<img src="http://seudominio.com.br/alteraStatus.php?idEnvio=16"class="imgEnvio"/>

Preferably, leave this image with width and height cleared.

img.imgEnvio{width:0; height: 0; border: 0}

So when the recipient opens the email, they will make a request to your page that will change the status of the submission.

However, if the user's email client is configured to block the message images, this solution will not work.

    
06.11.2014 / 12:44