How to get acknowledgement email once after user read it using PHP? [closed]

StackOverflow https://stackoverflow.com/questions/22299074

  •  12-06-2023
  •  | 
  •  

Pergunta

How to get acknowledgment email once after user read it using PHP?

Please find the process

1) Send an email to recipient.
2) Recipient read the email.
3) If the recipient read the email, acknowledgment send back to the sender.
4) This need to achieved using PHP.

Please suggest me on this.

Foi útil?

Solução

You Tagged phpmailer so I'm guessing you're using the phpmailer class.

There you just have to

$mail = new PHPMailer(); 
$mail->IsMail(); 
$mail->From = $senderEmail
$mail->ConfirmReadingTo = $confirmEmail
... body etc here ...

if your are not using phpmailer you have to add the "X-Confirm-Reading-To" header to your email.

Outras dicas

PHP won't be able to take any actions from the recipient's inbox. An alternative strategy would be...

1) include an image in the body of the email
2) serve the image with a token associated with the user's email
3) when the image is accessed on your server, use the token to determine who accessed it
4) send an email to the user from the server

Next time, please include more code, what you've tried and what has worked.

Two ways:

1: You can ask for a mail acknowledgement by sending a header with your e-mail:

Disposition-Notification-To: you@yourdomain.com

Most of the emailclients ignore this header, and most people just cancel this request when they see it.

2: You can include an invisible image in the email, which is actually an php script:

<img src="http://yourdomain.com/email.php?id=123">

which sends you the confirmation mail on request. Most mail clients disallow such images.

Conclusion: There isn't a very solid way..

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top