Php implementation to check whether the email has been read. When you send an email, you may want to know whether the email has been read by the recipient. Here is a very interesting code snippet that shows the actual date and time of reading the recipient's IP address record. when you send an email, you may wonder if the email has been read by the recipient. Here is a very interesting code snippet that shows the actual date and time when the recipient's IP address records are read.
The code is as follows:
Error_reporting (0 );
Header ("Content-Type: image/jpeg ");
// Get IP
If (! Empty ($ _ SERVER ['http _ CLIENT_IP '])
{
$ Ip = $ _ SERVER ['http _ CLIENT_IP '];
}
Elseif (! Empty ($ _ SERVER ['http _ X_FORWARDED_FOR '])
{
$ Ip = $ _ SERVER ['http _ X_FORWARDED_FOR '];
}
Else
{
$ Ip = $ _ SERVER ['remote _ ADDR '];
}
// Time
$ Actual_time = time ();
$ Actual_day = date ('Y. m. D', $ actual_time );
$ Actual_day_chart = date ('d/m/Y', $ actual_time );
$ Actual_hour = date ('H: I: S', $ actual_time );
// GET Browser
$ Browser = $ _ SERVER ['http _ USER_AGENT '];
// LOG
$ MyFile = "log.txt ";
$ Fh = fopen ($ myFile, 'A + ');
$ StringData = $ actual_day. ''. $ actual_hour.''. $ ip. ''. $ browser.''. "\ r \ n ";
Fwrite ($ fh, $ stringData );
Fclose ($ fh );
// Generate Image (Es. dimesion is 1x1)
$ Newimage = ImageCreate (1, 1 );
$ Grigio = ImageColorAllocate ($ newimage, 255,255,255 );
ImageJPEG ($ newimage );
ImageDestroy ($ newimage );
?>
Bytes. Here is a very interesting code snippet that shows the actual date and time when the recipient's IP address record is read...