Is it necessary to wrap long lines when sending emails?

送分小仙女□ 提交于 2019-11-30 03:39:46

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2696433/is-it-necessary-to-wrap-long-lines-when-sending-emails

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