PHP: Request a “Read Receipt” when sending emails


To get a Mail Read Receipt you should use “Disposition-notification-to: receipt_mail@gmail.com\r\n” . But this method will work only with outlook.

The example script is given below:

<?php
ini_set(‘SMTP’, ‘mail-fwd’);
$to = “To email address”;
$subject = “My subject”;
$txt = “Hello world!”;
$headers = “From: admin@m.com” . “\r\n” .
$headers .= “Disposition-notification-to: receipt_mail@gmail.com\r\n”;

mail($to,$subject,$txt,$headers);
echo “mail sent”;

?>

Leave a comment