PHP 发送的电子邮件有 =0A=0A 而不是换行
一段时间以来,我遇到了一些问题,即我的一些用户在通过 PHP 发送给他们的电子邮件中得到 =0A=0A 而不是新行。通过电子邮件客户端进行通信效果很好,但 PHP 生成的电子邮件对于某些用户(少数)来说总是这样。谷歌搜索没有显示出像样的结果,所有搜索结果似乎都以某种方式与 Outlook 有关 - 认为所有 Outlook 用户都会遇到这个问题是不可接受的。有谁知道处理此问题并避免这些新行编码问题的正确方法?
编辑:仅供参考,我正在使用 Zend 的 Mailer 类。
谢谢
编辑2:
更改编码类型不起作用。我将 header 编码为 base64,将 body 编码为 64,但出现了乱码。然后我尝试使用base64标头,并对正文执行base64_decode(base64_decode($body)),这对用户的“CNR服务器但不在收件箱中”来说没问题,无论这意味着什么。当我尝试将 mb_convert_encoding 转换为 base64 时,我再次得到了编码字符串而不是正文,所以没有用。
我还能尝试什么? Zend Mailer 仅支持 Quoted Printable 和 Base64 标头编码。不知道如何处理正文才能匹配引用的可打印编码......
For some time now I've had the problem of some of my users getting =0A=0A instead of new lines in emails I send to them via PHP. Correspondence via email client works well, but PHP generated emails always look like this with some users (a minority). Googling revealed no decent results, all search results seem to be connected with outlook somehow - and it is unacceptable to think that all outlook users would suffer from this problem. Does anyone know a correct way of handling this and avoiding these new line encoding issues?
Edit: FYI I'm using Zend's Mailer class.
Thanks
Edit 2:
Changing the encoding type did not work. I encoded the headers to base64, and the body to 64, got garbled stuff. Then I tried with base64 headers, and did base64_decode(base64_decode($body)) on the body, and that was fine on the user's "CNR Server but not in the inbox" whatever that means. When I tried mb_convert_encoding to base64, I got the encoded string instead of the body again, so no use.
What else can I try? Zend Mailer only supports Quoted Printable and Base64 header encoding. Not sure what to do to the body for it to match the quoted printable encoding...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
电子邮件正文已使用 quoted-printable 进行编码 -但电子邮件中声明的 mime 类型是 text/html (或 text/plain 或 undefined)。
如何使电子邮件正文的编码与 mime 标头匹配取决于您。
The email body has been encoded using quoted-printable - but the mime type declared in the email is text/html (or text/plain or undefined).
How you make the encoding of the body of the email match the mime header is up to you.