I create emails in a PHP application that attach multiple files to HTML email. Some of the files are Excel spreadsheets, some of which are company logos that need to be embedded in HTML, so they load by default using the Content-ID and cid identifiers to link to attached images.
As far as I can tell, my syntax is correct, but images never load inline images (they are attached successfully, however).
From: email@example.com Reply-To: email@example.com MIME-Version: 1.0 Content-type: multipart/mixed;boundary="d0f4ad49cc20d19bf96d4adf9322d567" Message-Id: < 20150421165500.0A5488021B@server > Date: Tue, 21 Apr 2015 12:54:59 -0400 (EDT) --d0f4ad49cc20d19bf96d4adf9322d567 Content-type: text/html; charset=utf-8 Content-transfer-encoding: 8bit <html> Html message goes here, followed by email.<br/> <img src="cid:mylogo" /> </html> --d0f4ad49cc20d19bf96d4adf9322d567 Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name=excelsheet.xlsx Content-Description: excelsheet.xlsx Content-Disposition: attachment; filename="excelsheet.xlsx"; size=24712; Content-transfer-encoding:base64 [base64 encoded string goes here.] --b19e863e2cf66b40db1d138b7009010c Content-Type: image/jpeg; name="mylogo.jpg" Content-transfer-encoding:base64 Content-ID: <mylogo> Content-Disposition: inline; filename="mylogo.jpg"; size=7579; [base64 encoded string goes here.] --b19e863e2cf66b40db1d138b7009010c--
Can someone see the obvious reason why the image will not be embedded as expected?
EDIT
Please note that this behavior is not common to all email clients. So far, only noted in Thunderbird.
fred2 source share