I am attempting to create an email application that sends inline images with PHPmailer.
I haven't found a solution to this simple problem...
I need to replace all the image(s);
<img alt="8ball.jpg" width="100" height="100"
src="http://www.example.com/uploads/8ball.jpg" alt="8 Ball" />
With this; Hoping that the CID: can come from the filename without ext.
<img alt="8 Ball" src="cid:8ball">
Am I looking at this all wrong?
You can use MsgHTML($message) method, where $message contains your html code. This will automatically include any images that are in your html code with inline images. In your example it might not work because you are using an absolute path to the image.
If your image source is src="images/8ball.jpg", MsgHTML will work. Otherwise you can set the cid as you did in the second part and call AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", $type = "application/octet-stream") explicitly.
Have a look at http://phpmailer.codeworxtech.com/index.php?pg=methods for more information on PHPmailer methods.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.