发送邮件时需要换行吗?

发布于 2024-08-29 14:02:38 字数 257 浏览 3 评论 0原文

我正在使用 Zend_Mail 发送电子邮件。很少有文章(例如此页面上的第一个示例)建议换行邮件正文中的长行。

问题:

  1. 如果任何行超过 70 个字符,是否有必要使用 wordwrap()?

  2. 这个“70”数字从何而来?

I'm using Zend_Mail to send emails. Few articles (like first example on this page) have suggested to wrap long lines in message body.

Questions:

  1. Is it necessary to use wordwrap(), in case any of line is larger than 70 characters?

  2. Where does this '70' figure come from?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扛起拖把扫天下 2024-09-05 14:02:38

RFC 28225322 有一个名为“线路长度限制”的部分 (2.1.1):

此规范对数量有两个限制
一行中的字符。每行字符不得超过
998 个字符,且不应超过 78 个字符,不包括
CRLF。

...

比较保守的78个字符建议是为了适应
显示这些的用户界面的许多实现
可能会截断或灾难性地换行的消息
每行超过 78 个字符,尽管事实上这样
实施不符合本意图
规格

看来,真正的限制是 998 个字符,而 78 个字符是您不需要担心的。

RFC 2822 and 5322 have a sections called Line Length Limits (2.1.1):

There are two limits that this specification 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 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

Sounds to me like the real limit is 998 characters and 78 is something that you don't really need to bother with.

人间不值得 2024-09-05 14:02:38

AFAIR,70 ~ 78,更可能是 80 的“保存”版本,来自老式终端,每行显示 80 个字符。在很早的时候,这些终端只是愚蠢的打印机,需要在服务器上准备好输出。这个 80 又来自于古老的打孔卡。打孔卡的物理尺寸(因此与 80 张限制有些密切相关)来自通常用于存放打孔卡的钱盘。

人类和科技都很难摆脱旧习惯。我推荐第一个关于 Javascript 的 Crockford 讲座,了解更多历史:http://yuiblog.com/crockford

AFAIR, the 70 ~ 78, more likely a "save" version of 80, comes from good old terminals, which displayed 80 characters per row. In the very early days these terminals were just dumb printers that needed their output prepared on the server. This 80 in turn comes from good old punchcards. The punchcard's physical size (and therefore somewhat closely related the 80 limit) comes from money trays, which were often used to store punchcards.

Humans and technology have a hard time getting rid of old habits. I recommend the first Crockford on Javascript talk for more history: http://yuiblog.com/crockford

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文