PHPMailer插件'=';每75个字符等号

PHPMailer插件'=';每75个字符等号,php,phpmailer,Php,Phpmailer,使用PHPMailer 5.2.14,电子邮件以文本/html格式发送。输出文本中每75个字符就有一个等号 我尝试使用,但它没有删除额外的等号: $email = new PHPMailer(); $email->From = 'from@example.com'; $email->FromName = 'FromUser'; $email->AddAddress( 'to@example.com' ); $email->Subject = 'This i

使用PHPMailer 5.2.14,电子邮件以文本/html格式发送。输出文本中每75个字符就有一个等号

我尝试使用,但它没有删除额外的等号:

$email = new PHPMailer();
$email->From      = 'from@example.com';
$email->FromName  = 'FromUser';
$email->AddAddress( 'to@example.com' );
$email->Subject   = 'This is a test';
$email->IsHTML(true);
$email->Body = "<p>This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; </p>";

// fix EOL here? 
$email->LE = PHP_EOL;

$email->Send();
$email=new PHPMailer();
$email->From=from@example.com';
$email->FromName='FromUser';
$email->AddAddress('to@example.com' );
$email->Subject='这是一个测试';
$email->IsHTML(true);
$email->Body=“这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。

”; //在这里修好EOL? $email->LE=PHP\u EOL; $email->Send();
收到后产生的来源:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><font face="arial"><base href="http://example.com/"><!-- </base> -->=
<p>This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This i=
s a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.=
&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; Th=
is is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a t=
est.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp;=
 </p></font>
=
这是一个测试。这是一个测试。这是一个测试。这个我=
这是一个测试。这是一个测试。这是一个测试。这是一个测试=
这是一个测试。这是一个测试。这是一个测试。Th=
这是一个测试。这是一个测试。这是一个测试。这是一个t=
美国东部时间。这是一个测试。这是一个测试。这是一个测试=

在Outlook中查看时会显示等号。当我向gmail帐户发送相同的文本/html时,不存在等号


对于使用Outlook的收件人,需要采取什么措施来消除这些游离的等号

以下是您的文档的外观:

<!DOCTYPE html>
<head>
   meta stuff and <base href...>
</head>
    <body>
    HTML stuff
    </body>
</html>

元材料和
HTML内容
任何超出此范围且不符合HTML的内容都会让你的一天感到沮丧

据我所知,你有属于
的meta,有属于
标记等等。如果没有正确的HTML文档结构,那么肯定会有问题。包括有效的doctype

关于
标签的简短旁注;它遭到了抨击


您可以使用内联CSS样式。不要使用
标记,因为大多数电子邮件客户端都会将其丢弃并忽略。

这是众所周知的,并且在电子邮件中非常常见。等号用作转义字符,行长限制为76个字符。如果Outlook无法识别这一点,您可能必须手动设置标题,告诉它它是以这种方式编码的。

我在PHPMailer中处理html电子邮件时也遇到了同样的问题。我测试了不同的东西,发现:

  • 如果邮件有一个特殊的长度,就会出现问题——在我的例子中,一行中超过1002个字母(当我删除了一些字母(与哪些字母无关),电子邮件是正确的)
  • 该问题仅在某些电子邮件程序中可见(例如,MS Outlook、网站t-online.de;雅虎没有问题)
  • 我已经测试了PHPMailer 5.2.7-5.2.14:PHPMailer>5.2.10中存在问题(PHPMailer 5.2.7-5.2.10中没有问题)
  • 解决方案,如“$mail->Encoding=“7bit”或“$mail->LE=PHP\u EOL;”没有为我工作
  • 通过isSmtp()发送电子邮件时没有问题
  • 在两个不同的服务器上测试:服务器1包含等号,服务器2不包含等号,但有错误的换行符-两个服务器上的php配置几乎相同>这似乎不是php问题
因此,对我来说,解决方案是“采用PHPMailer 5.2.10”,直到他们在新版本中解决问题为止-没有好的解决方案,但在我找到更好的解决方案之前,它对我有效;-)

$email=new PHPMailer();
$email->From=from@example.com';
$email->FromName='FromUser';
$email->AddAddress('to@example.com' );
$email->Subject='这是一个测试';
$email->IsHTML(true);
$email->Body=“这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。这是一项测试。&`enter code here`nbsp;这是一项测试。这是一项测试。这是一项测试。

”; //在这里修好EOL? $email->LE=PHP\u EOL; $email->Send();
带有
'$mail->Encoding='base64'它现在适用于v5.2.17。
希望这最终在v6中得到修复。

添加$email->crlf=“\r\n”;
您可以解决此问题。

我正在使用phpMailer 5.2.25并通过SendPulse网关发送。通过我的ISP直接使用SMTP没有问题,但在一行的75个字符后看到了“=”符号,因此它与行长度换行有关。设置$mail->Encoding='base64';根据asdfklgash的回答,阻止了等号的插入(通过A/B比较证明)。

请减少文本的大小,我们不需要太多行来理解有
=
。您使用什么代码对文本进行编码?如果在此处询问php问题不合适,请建议适当的sub。同样,对于投票结束此问题的个人,请建议适当的sub,而不是沉默地终止此问题。我还建议不要关闭此操作,因为自此回复起,标签
PHPMailer
已被“2055”次使用。甚至可能是本地问题和Outlook中的某些设置。就我所见,你有属于的元,有属于的元,等等。如果没有正确的HTML文档结构,那么肯定会有人抱怨。包括一个有效的doctype。@Fred ii-,添加html和body标记有效。如果你把这个作为一个答案,我会适当地相信你。我不知道为什么这个被选为正确答案。虽然这是个好建议,但与问题无关。这一切都与此有关。一定要查看他们的代码和他们试图发送的消息。Fred的答案是可靠的,但SusiMage在下面的答案(昨天发布)现在标记为选中的答案。查看他/她的帖子了解原因。@A如果很高兴看到你有自己的解决方案,干杯-我投了赞成票。5.2.10解决了问题。谢谢你的回答。
$email = new PHPMailer();
$email->From      = 'from@example.com';
$email->FromName  = 'FromUser';
$email->AddAddress( 'to@example.com' );
$email->Subject   = 'This is a test';
$email->IsHTML(true);
$email->Body = "<p>This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&`enter code here`nbsp; This is a test.&nbsp; This is a test.&nbsp; This is a test.&nbsp; </p>";

// fix EOL here? 
$email->LE = PHP_EOL;

$email->Send();