I have been searching for a way to properly inline images into emails for Sendy (Sendy.co)
. I have only found one way to do it. This method involves using src='cid:imagecidnamejpg'
as an attribute on the <img />
tags that you intend to inline. Example below if I attach a file named imagecidname.jpg
then my cid value in the src tag should be imagecidnamejpg
. As another example: if I use img01.png
, it will strip anything except a-z, 0-9 chars and you will be left img01png
as your corresponding cid value.
Replace $mail->AddAttachment($attachment);
in the /scheduled.php
and /includes/create/send-now.php
with
if (strpos($attachment, '.jpg') !== false || strpos($attachment, '.png') !== false)
{
$cid = preg_replace('/[^a-zA-Z0-9]+/', '', basename($attachment));
$mail->AddEmbeddedImage($attachment, $cid, basename($attachment));
} else {