gpt4 book ai didi

email - 多部分电子邮件中的数字是什么意思?

转载 作者:行者123 更新时间:2023-12-01 06:56:42 27 4
gpt4 key购买 nike

我正在查看来自 Thunderbird 的多部分消息的来源(希望从 C++/Javascript 编写我自己的多部分消息)

我想知道以下是什么意思(电子邮件的纯文本部分和 html 部分之间的部分)以及我如何为我自己的程序计算它以生成多部分电子邮件:

This is a multi-part message in MIME format.

------=_NextPart_32252.1057009685.31.001
Content-Type: multipart/alternative;
boundary="----=_NextPart_32252.1057009685.31.002"
Content-Description: Message in alternative text and HTML forms


------=_NextPart_32252.1057009685.31.002

(如所见 here )

其余的消息代码对我来说对帖子部分有意义。

最佳答案

您在边界分隔符内看到的数字不一定意味着任何东西 (尽管 RFC 不排除实现者尝试包含某些含义)。

它们必须是唯一的,并且不包含在它们封装的部分中。

来自 RFC 2046 :

5.1. Multipart Media Type

In the case of multipart entities, in which one or more different sets of data are combined in a single body, a "multipart" media type field must appear in the entity's header. The body must then contain one or more body parts, each preceded by a boundary delimiter line...

As stated previously, each body part is preceded by a boundary delimiter line that contains the boundary delimiter. The boundary delimiter MUST NOT appear inside any of the encapsulated parts, on a line by itself or as the prefix of any line...

...

5.1.1. Common Syntax

The Content-Type field for multipart entities requires one parameter, "boundary". The boundary delimiter line is then defined as a line consisting entirely of two hyphen characters ("-", decimal value 45) followed by the boundary parameter value from the Content-Type header field, optional linear whitespace, and a terminating CRLF.

...

NOTE: Because boundary delimiters must not appear in the body parts being encapsulated, a user agent must exercise care to choose a unique boundary parameter value. The boundary parameter value [could be] the result of an algorithm designed to produce boundary delimiters with a very low probability of already existing in the data to be encapsulated without having to prescan the data. ... The simplest boundary delimiter line possible is something like "---", with a closing boundary delimiter line of "-----".

关于email - 多部分电子邮件中的数字是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/794964/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com