Using PHPmailer, has anybody tried to send a tracking pixel, of course with its tracking parameters?
The only working way to send images through PHPmailer is embedded with cid, with code like this:
$mail->AddEmbeddedImage($file_path, $cid_name, $img_name);
Say I have a usual php file that outputs an image while taking track of the open email (writing into a db). If I put a parameter (any kind of) inside the file path or inside the file name, for use with cid, like this:
$token = "984168416987684198jkjkjhfoòiuvutiutciuythfgc";
$file_path_track_img = $imgs_path . "images/track_01.php?tok=" . token;
$cid_track_img = "trackimg";
$img_name_track = "track_01.png?tok=" . token;
echo "<img src='cid:" . $cid_track_img . "'></img>";
and then of course I tell to PHPmailer to use it, like this:
$mail->AddEmbeddedImage($file_path_track_img, $cid_track_img, $img_name_track);
PHPmailer returns error saying it cannot find the file. Doesn't matter if the parameter is written inside path variable or in filename variable, both of those tricks don't work.
I use PHPmailer for a mass amount of work, and "$mail->AddEmbeddedImage($file_path, $cid_name, $img_name)" works always fine.
Anyone has found a solution for sending tracking imgs with PHPmailer?