电子邮件主题长度限制是多少? [英] What is the email subject length limit?

查看:77
本文介绍了电子邮件主题长度限制是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Internet 电子邮件的主题行中允许有多少个字符?我扫描了 电子邮件的 RFC,但看不到具体允许多长时间是.我有一位同事想要以编程方式对其进行验证.

How many characters are allowed to be in the subject line of Internet email? I had a scan of The RFC for email but could not see specifically how long it was allowed to be. I have a colleague that wants to programmatically validate for it.

如果没有正式的限制,实践中建议的长度是多少?

If there is no formal limit, what is a good length in practice to suggest?

推荐答案

参见 RFC 2822,第 2.1.1 节开始.

See RFC 2822, section 2.1.1 to start.

这有两个限制标准名额一行中的字符.每一行字符不得超过 998字符,并且应该不超过78 个字符,不包括 CRLF.

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.

正如 RFC 稍后所述,您可以通过将主题折叠到多行来解决此限制(而不是您应该这样做).

As the RFC states later, you can work around this limit (not that you should) by folding the subject over multiple lines.

每个头域在逻辑上都是一个单行字符组成字段名称、冒号和场体.不过为了方便,并处理 998/78 字符每行限制,字段体头字段的一部分可以拆分成多行表示;这称为折叠".一般规则是,无论这个标准在哪里允许折叠空白(不只是 WSP 字符),一个 CRLF 可能是插入任何 WSP 之前.为了例如,标题字段:

Each header field is logically a single line of characters comprising the field name, the colon, and the field body. For convenience however, and to deal with the 998/78 character limitations per line, the field body portion of a header field can be split into a multiple line representation; this is called "folding". The general rule is that wherever this standard allows for folding white space (not simply WSP characters), a CRLF may be inserted before any WSP. For example, the header field:

       Subject: This is a test

可以表示为:

       Subject: This
        is a test

主题标题中不超过 78 个字符的建议听起来很合理.没有人愿意滚动查看整个主题行,而某些重要的内容可能会在右侧被截断.

The recommendation for no more than 78 characters in the subject header sounds reasonable. No one wants to scroll to see the entire subject line, and something important might get cut off on the right.

这篇关于电子邮件主题长度限制是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆