php - 发送电子邮件时是否需要换行?

标签 php zend-framework email word-wrap zend-mail

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

问题:

  1. 是否有必要使用 wordwrap(),以防任何一行大于 70 个字符?

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

最佳答案

RFC 28225322有一个称为行长度限制 (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

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

关于php - 发送电子邮件时是否需要换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2696433/

相关文章:

linux - 使用 NAIL 发送 HTML 邮件?

php - 使用 jquery ajax 更新 mysql

php - 如何通过 $_GET 使用较少的变量

php - 如何使用 Zend Framework 设置 Netbeans 自动完成?

phpUnit -assertQuery 失败并显示

php - BjyAuthorize 对象管理器

javascript - 使用 JavaScript/AJAX 将行插入数据库

php - 按分类法对 WordPress 自定义帖子进行分组

javascript - Sendgrid:渲染 ejs 模板,然后作为电子邮件发送。

php - 将 HTML 文件读入电子邮件