email - 我是否需要将长度超过 72 个字符的电子邮件换行?

标签 email standards

我偶尔会看到代码包装电子邮件以确保单行长度不超过 72 个字符。真的有必要这样做吗?这到底是怎么回事?

最佳答案

RFC 2822包含有关行长度的文本,这可能来自:

There are two limits that this standard places on the number of
characters in a line. Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

The 998 character limit is due to limitations in many implementations
which send, receive, or store Internet Message Format messages that simply cannot handle more than 998 characters on a line. Receiving
implementations would do well to handle an arbitrarily large number
of characters in a line for robustness sake. However, there are so many implementations which (in compliance with the transport requirements of [RFC2821]) do not accept messages containing more than 1000 character including the CR and LF per line, it is important for implementations not to create such messages.

The more conservative 78 character recommendation is to accommodate
the many implementations of user interfaces that display these
messages which may truncate, or disastrously wrap, the display of
more than 78 characters per line, in spite of the fact that such
implementations are non-conformant to the intent of this specification (and that of [RFC2821] if they actually cause information to be lost). Again, even though this limitation is put on messages, it is encumbant upon implementations which display messages

关于email - 我是否需要将长度超过 72 个字符的电子邮件换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4297574/

相关文章:

c++ - 如果比较函数不是 operator <,为什么 std::sort 会崩溃?

http - cookie 的名称是否区分大小写?

c++11 - 类外定义的默认 move 操作的异常规范是什么?

facebook - 如何在电子邮件中添加 Facebook 点赞按钮

python - 在 Python 中接收电子邮件

python - 我正在尝试使用 shell 命令在 python 中发送邮件。但变量不会在脚本中被替换

c++ - VC15中属性的使用

android - 为 Android 中的交易电子邮件集成 Mailchimp 的 Mandrill

email - Zend Mailer 错误 "From header set twice"

c++ - 阴影和 GCC -Wshadow