MIME type to satisfy HTML, email, images and plain text?

こ雲淡風輕ζ 提交于 2019-11-28 17:54:17

You are right. Inline images should be stored in a multipart/related mime-entity (RFC 2387) and offering multiple content-type options can be done with multipart/alternative (RFC 2046).
For adding attachments you may put the whole structure into a multipart/mixed and add the attachments.

  • multipart/mixed
    • multipart/alternative
      • text/plain
      • multipart/related
        • text/html
        • image/gif
        • image/gif
    • some/thing (disposition: attachment)
    • some/thing (disposition: attachment)

You can also use inline image in text/plain messages, but not all MUA support this. (Use none or disposition: inline)

  • multipart/mixed
    • text/plain (text above image)
    • image/gif
    • text/plain (text below image)

And I dont't know a clean way to combine this with a multipart/alternative HTML-email.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!