Using PHPMailer 5.2.14, emails are sent in text/html. The outgoing text is littered with equal signs every 75th character.
I tried using the EOL workaround, but it did not remove the extra equal signs:
$email = new PHPMailer();
$email->From = '[email protected]';
$email->FromName = 'FromUser';
$email->AddAddress( '[email protected]' );
$email->Subject = 'This is a test';
$email->IsHTML(true);
$email->Body = "<p>This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. </p>";
// fix EOL here?
$email->LE = PHP_EOL;
$email->Send();
Resulting source upon receipt:
<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. This is a test. This is a test. This i=
s a test. This is a test. This is a test. This is a test.=
This is a test. This is a test. This is a test. Th=
is is a test. This is a test. This is a test. This is a t=
est. This is a test. This is a test. This is a test. =
</p></font>
The equal signs appear when viewing in Outlook. When I send the same text/html to a gmail account, the equal signs are not present.
What needs to happen to eliminate these stray equal signs for recipients using Outlook?
I had the same problem with html-emails in PHPMailer. I've tested different things and found out:
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 ;-)
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.
Here's what your document should look like:
<!DOCTYPE html>
<head>
meta stuff and <base href...>
</head>
<body>
HTML stuff
</body>
</html>
Anything outside that and not conforming to HTML, will put a damper on your day.
Far as I can see, you have meta that belong in <head>
and have <font>
tags that belongs in <body>
etc. etc. If there isn't proper HTML document structuring, then something will complain for sure. Including a valid doctype.
A quick sidenote about the <font>
tag; it's in deprecation.
You could use inline CSS styling instead. Do not use <style>
tags as most Email clients will throw that out and ignore it.
With '$mail->Encoding = 'base64';
it works for us now with v5.2.17.
Hopefully this is finally fixed in v6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With