Following is example for track email viewed OR not?
<?php
$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 = "<img src=\"http://www.example.com/email.php?user_id=".$to." width=\"0\" height=\"0\" >";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: kelly@ymail.com' . "\r\n";
if (mail($to, $subject, $message, $headers) )
{
echo "Mail sent successfully";
}
else
{
echo "failed to send mail";
}
}
?>
Enjoy!
No comments:
Post a Comment