I have an email, sent by phpmailer using plaintext.
When this email is sent through php mail(), I get the exact email. When the email is sent through Exchange on Small business server it appears to insert unicode characters at some points. Example source code as received by email program:
php mail:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"
Dear J,
This is confirmation of your registration.
Event: Green City Dialogues: Toward a sustainable built environment in Christchurch (2): Green City Dialogues 2
Date: Monday, 19 September 2011 05:15 pm - 08:00 pm
Attendee: J D
Exchange server:
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"
X-TM-AS-Product-Ver: SMEX-10.1.0.1137-6.500.1024-18326.006
X-TM-AS-Result: No--12.011100-0.000000-31
X-TM-AS-User-Approved-Sender: Yes
X-TM-AS-User-Blocked-Sender: No
X-DSPAM-Check: by xxx.xxx.xxx on Wed, 17 Aug 2011 11:59:06 +1200
X-DSPAM-Result: Innocent
X-DSPAM-Processed: Wed Aug 17 11:59:06 2011
X-DSPAM-Confidence: 0.5596
X-DSPAM-Probability: 0.0000
Dear xxxxx,
This is confirmation of your registration.
Event:=A0Green City Dialogues: Toward a sustainable built environment in Ch=
ristchurch (2): Green City Dialogues 2
Date: Monday, 19 September 2011 05:15 pm - 08:00 pm
It turns out that the plaintext email through the Unix server contains the a0 character as well and it is filtered out by Gmail, even in the source code view.
The problem was
html_entity_decode($result[‘introtext’])
The fix
html_entity_decode($result[‘introtext’],ENT_COMPAT,’UTF-8′)