電子メールの開封率を追跡するために、サーバーから送信する大量の電子メールでピクセルを起動しています。スクリプトは Mac Mail で動作しています。メールが受信され、ピクセルがダウンロードされます。
ただし、Yahoo メール クライアントでは機能しません。電子メールが受信され、参照された画像がダウンロードされて表示されますが、ピクセルは起動/ダウンロードされず、php スクリプトも実行されません (私の知る限り)。なぜこれが Yahoo メール クライアントや、まだテストしていない他のクライアントで発生する可能性があるのかを知っている人はいますか?
HTMLのimgタグは次のとおりです。
<img src="http://mysite.com/email_track.php?email=email_value&country=country_value&state=state_value" />
phpスクリプトは次のとおりです。
<?php
// Database code omitted
$result= mysql_query("INSERT INTO `CelebrationOpens` SET `time` = NOW(), `country` = '$country', `state` = '$state', `email` = '$email' ") or die(mysql_error());
// Create an image, 1x1 pixel in size
$im=imagecreate(1,1);
// Set the background colour
$white=imagecolorallocate($im,255,255,255);
// Allocate the background colour
imagesetpixel($im,1,1,$white);
// Set the image type
header("content-type:image/jpg");
// Create a JPEG file from the image
imagejpeg($im);
// Free memory associated with the image
imagedestroy($im);
?>
また、次のようにピクセルを起動しようとしました:
$name = './concert/pixel.png';
$fp = fopen($name, 'rb');
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));
fpassthru($fp);
exit;