PHP发送的邮件已经= 0A = 0A而不是新行 [英] PHP sent emails have =0A=0A instead of new lines

查看:149
本文介绍了PHP发送的邮件已经= 0A = 0A而不是新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在有一段时间,我遇到了一些我的用户获得= 0A = 0A的问题,而不是通过PHP发送给他们的电子邮件中的新行。通过电子邮件客户端的函件工作得很好,但PHP生成的电子邮件总是与某些用户(少数)一样。 Google搜索结果没有显示出不错的结果,所有搜索结果似乎都与Outlook的前景无关,而且认为所有的Outlook用户都将遭受这个问题,这是不能接受的。有没有人知道正确的处理方法,并避免这些新的行编码问题?



编辑:FYI我使用的是Zend的Mailer类。



谢谢



编辑2:



更改编码类型不起作用。我编码的头到base64,身体到64,有乱码的东西。然后我尝试使用base64头文件,并在主体上做了base64_decode(base64_decode($ body))),这在用户的CNR服务器但不在收件箱中是好的,这意味着什么。当我尝试mb_convert_encoding到base64时,我得到了编码的字符串而不是身体,所以没有用。



我还可以尝试什么? Zend Mailer仅支持Quoted Printable和Base64标头编码。不确定该怎么做才能匹配引用的可打印编码...

解决方案

电子邮件正文已编码使用 quoted-printable - 但是声明的MIME类型电子邮件是text / html(或文本/简单或未定义)。



如何使邮件正文的编码与mime标头匹配取决于您。


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

解决方案

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.

这篇关于PHP发送的邮件已经= 0A = 0A而不是新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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