18-Feb-24
We are using gmail, yahoo, hotmail etc to send emails to our friends, relatives etc. We dont know whether the email that we sent was read by the recipient or not. To get the read receipts, we need paid accounts from the Mail providers.
Here i am going to show you a simple php program script to get read receipts of the emails that we sent.
$user_id = $_GET['user_id'];
If ( $user_id )
{
$FileName = $id.".txt";
$ourFileHandle = fopen($FileName, 'w') or die("can't open file");
fclose($ourFileHandle);
}
else
{
$to = "jhon@gmail.com"; //to address
$subject ="Read Receipt Email";
$message = "Testing whether the read receipt script works or not";
$message = " $headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= 'From: kelly@ymail.com' . "rn";
if (mail($to, $subject, $message, $headers) )
{
echo "Mail sent successfully";
}
else
{
echo "failed to send mail";
}
}
?>
Lets call this php script page name as email.php and the website domain name as www.example.com. The url of this page is http://www.example.com/email.php.
Now the user_id parameter contains a When you open this page (http://www.example.com/email.php) on the browser, then the script first tries to read the get parameter user_id and checks whether there is any value in the parameter.
© Copyright 2025, All right reserved by Smartwebin