Search code examples
phpemailpearmimequoted-printable

PHP PEAR Mail '='


When sending out HTML emails via PEAR, although it renders correctly on email clients, when looking at the message source the text has lots of = signs.

Example

blah blah blah blah blah blah blah blah blah blah blah blah blah blah=blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah=blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah= blah blah blah blah blah blah

Any ideas why and how they can be removed? Do they cause any issues?


Solution

  • It is part of the (oldschool but still used!) quoted-printable encoding that represents a 8-bit ASCII string in 7-bit ASC codeset. All characters that are >127 are encoded in the form =F3, which is a hexadecimal representation of the character. Read more at Wikipedia on quoted-printable

    To read the message, you must apply quoted_printable_decode() to the string. or use a proper MIME Mail decoder that will resolve other issue's that you will encounter when trying to parse mails, too.

    It does not cause issues - it solves them.