![](/img/trans.png)
[英]How to use "quoted-printable" content-transfer-encoding with BizTalk AS2 receiving?
[英]What Content-Transfer-Encoding should I use when sending a PHP mail() containing a long http-link?
我有一个发送电子邮件的脚本,看起来像这样:
$headers = "From: test@example.com\r\n";
$headers .= "Reply-To: test@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=utf-8\r\n";
$headers .= "Content-Transfer-Encoding: 8bit";
$orgsubject = "A subject with some swedish characters like å, ä and ö";
$newsubject='=?UTF-8?B?'.base64_encode($orgsubject).'?=';
$body = 'A lot of text.
Some more text.
A long URL:
http://example.com/subpage/?id=1234&hash=23jh4lk2j3h4lkjh674598xzxlk2j34h&anotherhash=h2k3j4h23kh42kj34h2lk3';
它已经过全面测试,但我认为Outlook用户中的一些用户会获得如下所示的URL: http : //example.com/subpage/?id=3D1234&hash=3D3D23jh4lk2j3h4lkjh674598xzxlk2j34h&anotherhash=3Dh2k3j4h23kh42kj34h2lk3 '等号是' URL对我而言毫无用处。 我想这与Content-Transfer-Encoding或Content-type有关,我是否需要将正文消息编码为base64或其他内容?
刚刚找到此论坛帖子: https : //stackoverflow.com/a/7289434/513321因此,我删除了Content-Transfer-Encoding,它似乎正常运行,但另一方面,在包含URL的URL中,我永远无法重现该错误。 '3D'文字,所以我不确定这是否可行。 有谁知道删除Content-Transfer-Encoding是否可以解决我的问题?
您的问题中没有提到这一点,但是=3D
是引用的可打印传输编码的转义序列; 它用于使用7位编码安全地传输8位数据。
仍然存在不喜欢超过76列的行的邮件服务器,并且中间服务器可以在不更新消息头的情况下处理您的消息,从而导致观察到的行为。
从5.3.0开始,您可以使用quoted_printable_encode()
对消息进行编码,并相应地设置Content-Transfer-Encoding标头:
Content-Transfer-Encoding: quoted-printable
设置显式的传输编码是一种好习惯,您应该采用而不是单纯的“某种程度上可行”的方法:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.