你在电子邮件中使用自动换行吗?

时间:2021-04-21 20:23:58

I'm wondering if word wrapping should be applied in text emails? And what about HTML emails? If so, what character would you normally wrap at?

我想知道是否应该在文本电子邮件中应用自动换行?那么HTML电子邮件呢?如果是这样,你通常会包裹什么角色?

9 个解决方案

#1


RFC 2646 says:

RFC 2646说:

The Text/Plain media type is the lowest common denominator of Internet email, with lines of no more than 997 characters (by convention usually no more than 80)

文本/纯文本类型是Internet电子邮件的最小公分母,行不超过997个字符(按惯例通常不超过80个)

Another popular standard is to wrap at 72 characters. This dates back to many console applications (like EDIT and many BBS interfaces) that displayed text within an ASCII "window" including a border and scrollbar, allowing slightly less than 80 characters to be displayed.

另一个流行的标准是包装72个字符。这可以追溯到许多控制台应用程序(如EDIT和许多BBS接口),它们在ASCII“窗口”中显示文本,包括边框和滚动条,允许显示少于80个字符。

#2


Google says Results 1 - 10 of about ...

谷歌说结果1 - 10约...

3,160 for +word +wrap +email +"80 characters"
2,820 for +word +wrap +email +"50 characters"
1,790 for +word +wrap +email +"60 characters"
1,720 for +word +wrap +email +"70 characters"
1,540 for +word +wrap +email +"100 characters"
1,250 for +word +wrap +email +"65 characters"
1,120 for +word +wrap +email +"40 characters"
  962 for +word +wrap +email +"75 characters"
  836 for +word +wrap +email +"72 characters"

#3


It is common to wrap lines at 72 (80 is also common but that means that it will go over 80 when quoted) to handle at least one or two levels of quotation. There is the "text/flowed" MIME type which means that the client will wrap text itself at window's boundaries but not that many clients support it. Just setup your editor to wrap at 72 and you will be safe and readable by the most people.

通常将线包裹在72处(80也是常见但这意味着它在引用时将超过80)以处理至少一个或两个引用级别。存在“文本/流动”MIME类型,这意味着客户端将文本本身包装在窗口的边界,但不是许多客户端支持它。只需将您的编辑器设置为72即可,大多数人都会安全可读。

EDIT: the exact type is text/plain with the addition of format=flowed like this:

编辑:确切的类型是text / plain,添加format = flowed如下:

Content-Type: text/plain; format=flowed

See rfc2646 for explanations.

有关说明,请参阅rfc2646。

HTML mail should be avoided IMNSHO, not everybody reads mail in a browser or have HTML-enabled mail clients. Most reasons to use HTML (enriching mail with underline, bold and such) can be emulated. HTML doesn't need to be wrapped as the client will adapt to the window size.

应避免使用HTML邮件IMNSHO,并非每个人都在浏览器中阅读邮件或拥有支持HTML的邮件客户端。可以模拟使用HTML的大多数理由(使用下划线,粗体等来丰富邮件)。 HTML不需要包装,因为客户端将适应窗口大小。

An alternative to HTML is the "text/enriched" MIME type which gives you most of the advantages of HTML mails w/o the hassle but again, may not be supported everywhere.

HTML的另一种选择是“文本/丰富”的MIME类型,它可以为您提供HTML邮件的大部分优势,但不会在任何地方得到支持。

See here for text/enriched.

在这里查看文字/丰富。

#4


I often find myself starting e-mail replies with:

我经常发现自己开始发送电子邮件回复:

[Format recovered--see http://www.lemis.com/grog/email/email-format.php]

which I got from Greg Lehey. Part of that page says:

我是从Greg Lehey那里得到的。该页面的一部分说:

Clearly, there must be some way of specifying that the message text should not be wrapped. That's text/plain. There are special MIME attachment types which allow wrapping, although I still think that this is a bad idea. If you specify that your message may be wrapped, you're making an assumption about what the receiver's screen looks like. Even if you're right some of the time, you can't be right all of the time. For example, one person may have a screen 200 characters wide in order to be able to display long log file entries, but he won't want to see his text that long.

显然,必须有一些方法来指定不应该包装消息文本。那是文/普通的。有一些特殊的MIME附件类型允许包装,但我仍然认为这是一个坏主意。如果您指定可以包装您的消息,那么您就会假设接收者的屏幕是什么样的。即使你在某些时候是对的,你也不可能一直都是对的。例如,一个人可能有200个字符宽的屏幕,以便能够显示长日志文件条目,但他不希望看到他的文本那么久。

#5


A good mail API like JavaMail will do this for you. Ideally, you would not have to think about this issue explicitly.

像JavaMail这样的好邮件API会为你做这件事。理想情况下,您不必明确考虑此问题。

#6


RFC 5322

http://tools.ietf.org/html/rfc5322#section-2.1.1

2.1.1. 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.

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

The 998 character limit is due to limitations in many implementations that send, receive, or store IMF messages which 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 that (in compliance with the transport requirements of [RFC5321]) do not accept messages containing more than 1000 characters including the CR and LF per line, it is important for implementations not to create such messages.

998字符限制是由于许多实现中的限制,这些实现发送,接收或存储IMF消息,这些消息在一条线路上无法处理超过998个字符。为了鲁棒性,接收实现可以很好地处理一行中任意大量的字符。但是,有很多实现(符合[RFC5321]的传输要求)不接受包含超过1000个字符的消息,包括每行的CR和LF,对于不创建此类消息的实现很重要。

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 [RFC5321] if they actually cause information to be lost). Again, even though this limitation is put on messages, it is incumbent upon implementations that display messages to handle an arbitrarily large number of characters in a line (certainly at least up to the 998 character limit) for the sake of robustness.

更保守的78字符建议是为了容纳显示这些消息的用户界面的许多实现,这些消息可能截断或者灾难性地换行每行超过78个字符的显示,尽管这样的实现不符合这些实现。本规范的意图(以及[RFC5321]的意图,如果它们实际上导致信息丢失)。同样,即使对消息施加了这种限制,为了鲁棒性,在显示消息的实现中有义务处理一行中的任意大量字符(当然至少达到998字符限制)。

See also: RFC2045, RFC2046, RFC2047, RFC2049, RFC4289 & RFC6838 for MIME specs.

另请参阅:用于MIME规范的RFC2045,RFC2046,RFC2047,RFC2049,RFC4289和RFC6838。

It's fun reading RFCs. You know you love it :-)

阅读RFC很有趣。你知道你喜欢它:-)

#7


Generally you should wrap at 80, or a little less to allow dim clients to quote without wrapping.

一般来说,你应该以80或更低的速度换行,以允许昏暗的客户报价而不包装。

#8


Wrap at the first whitespace character before the 72nd position, or at the 72nd position if there isn't one. In Eudora when I used to use it, the convention was to leave a space at the end of the line indicating that it was wrapped, so it would signal the receiving client to re-flow the paragraph wherever it needed based on the width of the client's window. I'm not sure that this is the case in current email clients.

在第72个位置之前包裹第一个空白字符,如果没有第一个空白字符则包含在第72个位置。在Eudora,当我以前使用它时,惯例是在行的末尾留下一个空格,表明它已被包装,因此它将指示接收客户端根据所需的宽度重新流动段落。客户的窗口。我不确定当前的电子邮件客户端是这种情况。

#9


Didn't use linewrap, until I had switched to mutt/xterm (never looking back).

没有使用linewrap,直到我切换到mutt / xterm(从不回头)。

#1


RFC 2646 says:

RFC 2646说:

The Text/Plain media type is the lowest common denominator of Internet email, with lines of no more than 997 characters (by convention usually no more than 80)

文本/纯文本类型是Internet电子邮件的最小公分母,行不超过997个字符(按惯例通常不超过80个)

Another popular standard is to wrap at 72 characters. This dates back to many console applications (like EDIT and many BBS interfaces) that displayed text within an ASCII "window" including a border and scrollbar, allowing slightly less than 80 characters to be displayed.

另一个流行的标准是包装72个字符。这可以追溯到许多控制台应用程序(如EDIT和许多BBS接口),它们在ASCII“窗口”中显示文本,包括边框和滚动条,允许显示少于80个字符。

#2


Google says Results 1 - 10 of about ...

谷歌说结果1 - 10约...

3,160 for +word +wrap +email +"80 characters"
2,820 for +word +wrap +email +"50 characters"
1,790 for +word +wrap +email +"60 characters"
1,720 for +word +wrap +email +"70 characters"
1,540 for +word +wrap +email +"100 characters"
1,250 for +word +wrap +email +"65 characters"
1,120 for +word +wrap +email +"40 characters"
  962 for +word +wrap +email +"75 characters"
  836 for +word +wrap +email +"72 characters"

#3


It is common to wrap lines at 72 (80 is also common but that means that it will go over 80 when quoted) to handle at least one or two levels of quotation. There is the "text/flowed" MIME type which means that the client will wrap text itself at window's boundaries but not that many clients support it. Just setup your editor to wrap at 72 and you will be safe and readable by the most people.

通常将线包裹在72处(80也是常见但这意味着它在引用时将超过80)以处理至少一个或两个引用级别。存在“文本/流动”MIME类型,这意味着客户端将文本本身包装在窗口的边界,但不是许多客户端支持它。只需将您的编辑器设置为72即可,大多数人都会安全可读。

EDIT: the exact type is text/plain with the addition of format=flowed like this:

编辑:确切的类型是text / plain,添加format = flowed如下:

Content-Type: text/plain; format=flowed

See rfc2646 for explanations.

有关说明,请参阅rfc2646。

HTML mail should be avoided IMNSHO, not everybody reads mail in a browser or have HTML-enabled mail clients. Most reasons to use HTML (enriching mail with underline, bold and such) can be emulated. HTML doesn't need to be wrapped as the client will adapt to the window size.

应避免使用HTML邮件IMNSHO,并非每个人都在浏览器中阅读邮件或拥有支持HTML的邮件客户端。可以模拟使用HTML的大多数理由(使用下划线,粗体等来丰富邮件)。 HTML不需要包装,因为客户端将适应窗口大小。

An alternative to HTML is the "text/enriched" MIME type which gives you most of the advantages of HTML mails w/o the hassle but again, may not be supported everywhere.

HTML的另一种选择是“文本/丰富”的MIME类型,它可以为您提供HTML邮件的大部分优势,但不会在任何地方得到支持。

See here for text/enriched.

在这里查看文字/丰富。

#4


I often find myself starting e-mail replies with:

我经常发现自己开始发送电子邮件回复:

[Format recovered--see http://www.lemis.com/grog/email/email-format.php]

which I got from Greg Lehey. Part of that page says:

我是从Greg Lehey那里得到的。该页面的一部分说:

Clearly, there must be some way of specifying that the message text should not be wrapped. That's text/plain. There are special MIME attachment types which allow wrapping, although I still think that this is a bad idea. If you specify that your message may be wrapped, you're making an assumption about what the receiver's screen looks like. Even if you're right some of the time, you can't be right all of the time. For example, one person may have a screen 200 characters wide in order to be able to display long log file entries, but he won't want to see his text that long.

显然,必须有一些方法来指定不应该包装消息文本。那是文/普通的。有一些特殊的MIME附件类型允许包装,但我仍然认为这是一个坏主意。如果您指定可以包装您的消息,那么您就会假设接收者的屏幕是什么样的。即使你在某些时候是对的,你也不可能一直都是对的。例如,一个人可能有200个字符宽的屏幕,以便能够显示长日志文件条目,但他不希望看到他的文本那么久。

#5


A good mail API like JavaMail will do this for you. Ideally, you would not have to think about this issue explicitly.

像JavaMail这样的好邮件API会为你做这件事。理想情况下,您不必明确考虑此问题。

#6


RFC 5322

http://tools.ietf.org/html/rfc5322#section-2.1.1

2.1.1. 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.

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

The 998 character limit is due to limitations in many implementations that send, receive, or store IMF messages which 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 that (in compliance with the transport requirements of [RFC5321]) do not accept messages containing more than 1000 characters including the CR and LF per line, it is important for implementations not to create such messages.

998字符限制是由于许多实现中的限制,这些实现发送,接收或存储IMF消息,这些消息在一条线路上无法处理超过998个字符。为了鲁棒性,接收实现可以很好地处理一行中任意大量的字符。但是,有很多实现(符合[RFC5321]的传输要求)不接受包含超过1000个字符的消息,包括每行的CR和LF,对于不创建此类消息的实现很重要。

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 [RFC5321] if they actually cause information to be lost). Again, even though this limitation is put on messages, it is incumbent upon implementations that display messages to handle an arbitrarily large number of characters in a line (certainly at least up to the 998 character limit) for the sake of robustness.

更保守的78字符建议是为了容纳显示这些消息的用户界面的许多实现,这些消息可能截断或者灾难性地换行每行超过78个字符的显示,尽管这样的实现不符合这些实现。本规范的意图(以及[RFC5321]的意图,如果它们实际上导致信息丢失)。同样,即使对消息施加了这种限制,为了鲁棒性,在显示消息的实现中有义务处理一行中的任意大量字符(当然至少达到998字符限制)。

See also: RFC2045, RFC2046, RFC2047, RFC2049, RFC4289 & RFC6838 for MIME specs.

另请参阅:用于MIME规范的RFC2045,RFC2046,RFC2047,RFC2049,RFC4289和RFC6838。

It's fun reading RFCs. You know you love it :-)

阅读RFC很有趣。你知道你喜欢它:-)

#7


Generally you should wrap at 80, or a little less to allow dim clients to quote without wrapping.

一般来说,你应该以80或更低的速度换行,以允许昏暗的客户报价而不包装。

#8


Wrap at the first whitespace character before the 72nd position, or at the 72nd position if there isn't one. In Eudora when I used to use it, the convention was to leave a space at the end of the line indicating that it was wrapped, so it would signal the receiving client to re-flow the paragraph wherever it needed based on the width of the client's window. I'm not sure that this is the case in current email clients.

在第72个位置之前包裹第一个空白字符,如果没有第一个空白字符则包含在第72个位置。在Eudora,当我以前使用它时,惯例是在行的末尾留下一个空格,表明它已被包装,因此它将指示接收客户端根据所需的宽度重新流动段落。客户的窗口。我不确定当前的电子邮件客户端是这种情况。

#9


Didn't use linewrap, until I had switched to mutt/xterm (never looking back).

没有使用linewrap,直到我切换到mutt / xterm(从不回头)。