PHPMailer inserts '=' equal sign every 75th character

This is known as quoted-printable encoding and is quite common in email messages. The equal sign is used as an escape character, and line lengths are limited to 76 characters. If Outlook is not recognizing this, you may have to manually set headers telling it that it's encoded in this fashion.


I had the same problem with html-emails in PHPMailer. I've tested different things and found out:

  • The problem happens if the message has a special length - in my case >1002 letters in one line (when I have removed some letters (irrelevant which ones) the email was correct)
  • The problem is visible only in some email-programms (e.g. MS Outlook, website t-online.de; no problems with yahoo)
  • I've testet PHPMailer 5.2.7 - 5.2.14: The problem exists in PHPMailer >5.2.10 (no problems in PHPMailer 5.2.7 - 5.2.10)
  • Solutions like '$mail->Encoding = "7bit";' or '$mail->LE = PHP_EOL;' didn't worked for me
  • No Problems when sending the email via isSmtp().
  • Tested on two different servers: Server 1 contains equal signs, Server 2 doesn't contain that signs but has wrong linebreaks - the php-configuration on both servers is nearly identical > it doesn't seem to be a php-problem

So for me the solution was "take PHPMailer 5.2.10" till they solve the problem in a newer version - No good solution, but it works for me till I find a better one ;-)

Tags:

Php

Phpmailer