PHPMailer Embedded Attachments

5 Dec, 2006 | GeneralTdp

This is partly for me and partly for anyone who is currently hunting high and low for a solution to a problem I was having with PHPMailer and embedded images in HTML emails. The problem was that despite me being confident my code to insert the image was right, it was still appearing as an attachment (in Thunderbird at least). It turns out that the problem was the content type declaration, Thunderbird is very strict in it's settings for attachments and doesn't like the default application/octet-stream setting if you're attaching images, so you have to make sure to set it correctly for the image you are embedding. I can't take the credit, I found the answer on the sourceforge mailing list, after digging, a lot.

Hopefully, when Google gets here, that'll save someone some head scratching.