PHPMailer Embedded Attachments

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.

1 Comment

  1. Romain MOREL

    Thanks a lot for the trackback,

    I was dealing the same problem on my eCommerce projet, because of the restrictive mimetype checks of thunderbird ...

Post a Comment