How to know if the e-mail has reached the Recipient?

Asked

Viewed 1,795 times

4

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

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

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

I did several searches on the Internet but so far I found nothing... I thank you from now on help from all

  • In principle, the only way would be to have a Beacon embedded in email with a unique ID (an image linked to your server). Still not guaranteed (because the person can block access to external images in the email).

  • cc @Bacco In fact, the email sending protocol offers a mechanism to receive a reply when the email arrives at the Registry (confirmation of delivery), as well as a mechanism to receive a reading confirmation. The recipient, in turn, can configure their client not to send these confirmations (this is also provided for in the protocol). Now you search whether the library you use to send emails offers a property for you to set and enjoy these features.

  • Which, by the way, has a much lower efficiency index than the Beacon currently. But it is a valid observation.

  • @Bacco Many email clients, by default, also do not display images linked until the user confirms that he wants to do so.

  • In a search for "phpmailer delivery report" I found this answer: http://stackoverflow.com/a/1078300/1274092 (although it does not use phpMailler properties but rather a property in the email metadata header). This search returns more things that may be interesting to you.

  • @Tafarel_brayan if you are going to use the confirmation by header, as sugared by Caffé, remember to create a unique ID for the response address, to make sure that the confirmation was from the expected message. For example, [email protected], so you can automate confirmations. The Beacon It is less complicated because it is accessed directly on your server, not needing an email reader. Nothing prevents using the 2 techniques and even by a link in the final message so that the person can manually click and confirm the receipt. PS: You can use the app’s own logo as Beacon.

Show 1 more comment

1 answer

2

There is a possible solution that can help you.

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

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

Where 0 = E-mail awaiting sending, 1 = E-mail sent, 2 = E-mail Read

On your server, create a page that receives idEnvio 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 zero width and height.

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

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.