开发者

Problem of subject (and body) email encoding when sending a message from 2 different servers

I have switched the encoding of sent emails, with the patch related in this post:

Email from PHP has broken Subject header encoding

It works great from one of our server, (in Outlook and gmail)

To: coil@domain.com
Subject: =?UTF-8?B?U3VqZXQgYXZlYyBkw6lzIGFjY8Oow6jDqMOow6jDqMOobnRzIOKCrCAhIQ==?=
Date: Wed, 31 Aug 2011 16:37:38 +0200

The subject and body are OK.

But on the second server, there is a weird behaviour, I get this email header for the subject:

To: coil@domain.com
Subject: =?US-ASCII?开发者_高级运维B?PT9VVEYtOD9CP1UzVnFaWFFnWVhabFl5?=
 =?US-ASCII?B?Qmt3Nmx6SUdGalk4T293NmpEcU1Pb3c2akRxTU9vYm5SeklPS0NyQ0FoSVE9?=
 =?US-ASCII?B?PT89?=

It seems that the subject is re-encoded and forced to US-ASCII, it leads to an unreadable subject and the UTF8 characters are lost in the body.

The same test script and email class is used on both servers.

Any idea where this bug could comes from ?


The bug was due to the mbstring.func_overload value. It was changed from 7 to 6 and now it works as expected. Thanks for your help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜