Using Content-ID and cid for embedded email images in Thunderbird

前端 未结 1 1572
天命终不由人
天命终不由人 2020-12-19 15:14

I\'m generating emails in a PHP application which attach multiple files to an HTML email. Some of the files are Excel spreadsheets, some of the files are company logos which

相关标签:
1条回答
  • 2020-12-19 15:49

    I noticed two issues:

    1. The MIME-boundary is inconsistent. For the first attachment it's d0f4ad49cc20d19bf96d4adf9322d567 and then b19e863e2cf66b40db1d138b7009010c is used. Thus, technically the second attachment is "part" of the first attachment.

      If you replace all b19e863e2cf66b40db1d138b7009010c by d0f4ad49cc20d19bf96d4adf9322d567 Thunderbird correctly identifies the image attachment.

    2. Use multipart/related instead of multipart/mixed. (see RFC2387)

      A multipart/related is used to indicate that each message part is a component of an aggregate whole. It is for compound objects consisting of several inter-related components - proper display cannot be achieved by individually displaying the constituent parts. The message consists of a root part (by default, the first) which reference other parts inline, which may in turn reference other parts. Message parts are commonly referenced by the "Content-ID" part header. (see Wikipedia entry for MIME multipart/related)

    0 讨论(0)
提交回复
热议问题