多部分/替代子类型,客户何时使用? [英] Multipart/alternative subtype, when client use it?
问题描述
为什么网络邮件(如Gmail)使用 multipart/alternative子类型(当使用HTML编写时)发送MIME消息,而其他电子邮件却以MIME形式发送HTML,其中包含text/html部分(不使用替代子类型)? /p>
Why webmails (like Gmail) sends MIME messages using multipart/alternative subtype (when composing in HTML) while others send HTML as MIME with text/html parts inside (without using alternative subtype)?
推荐答案
multipart/alternative
表示每个部分都是相同(或相似)内容的替代"版本,每个部分均以其"Content-类型"标题.格式是根据对原始格式的忠实程度进行排序的,最不忠实的是最原始的,最不忠实的是最不忠实的.
multipart/alternative
indicates that each part is an "alternative" version of the same (or similar) content, each in a different format denoted by its "Content-Type" header. The formats are ordered by how faithful they are to the original, with the least faithful first and the most faithful last.
Gmail之类的邮件代理知道他们在做什么,然后将text/html
转换为text/plain
并将两种选择都放入电子邮件中,然后让接收方决定使用哪种选择.
Mail-agents like Gmail know what they are doing, and convert the text/html
to text/plain
and put both alternatives into there emails and let the receiving end decide which alternative to use.
也有一些邮件代理人不知道如何从html内容中提取纯文本版本,只是因为开发人员无需费心实现它,因此他们只发送text/html
而没有其他选择.
There are also mail-agents that don't know how to extract a text-only version from the html content, just because the developer did not bother to implement it, so they only send text/html
with out any alternatives.
有时-我称他们为疯子"-发送multipart/alternative
,但实际上只放置了text/html而没有其他选择.确实不是很好,但这并不违反任何规范.
And sometimes - i call them the crazy ones - send multipart/alternative
, but actually only put text/html without any alternatives. Which is not really nice, but it is not against any spec.
这篇关于多部分/替代子类型,客户何时使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!