views:

357

answers:

3

Hi all, currently using PHP5 with htmlMimeMail 5 (http://www.phpguru.org/static/mime.mail.html) to send HTML e-mail communications. Have been having issues with a number of recipients seeing random characters replaced with equals signs e.g.:

"Good mor=ing. Our school is sending our newsletter= and information through a company called..."

Have set e-mail text, HTML, and header encoding to UTF-8. The template files loaded by PHP for the e-mail (just include()'d text/HTML with a few php tags in them) are both encoded in UTF-8.

The interesting thing is that I can't duplicate the problem on any of my e-mail clients, and can't find any information by searching yahoo/googlies that would point me at the problem!!

A: 

Try sending with 8-bit encoding:

$message->setTextEncoding(new EightBitEncoding());
$message->setHTMLEncoding(new EightBitEncoding());
Sean Bright
Put me in the right direction; had to use Base64Encoding.
Keith Humm
A: 

I suspect your problem is related to older versions of Exchange. Equal signs at end of line:

It may not be the quoted printable thing with high/low order characters or the encoding. Also, elsewhere on that page it says:

NOTE: A bug ("feature"?) in Exchange may cause line feeds to be replaced with equal signs when rich text mail is disabled.

cletus
Nice find! But the characters replaced aren't at the end of the line or line feeds so I'm not sure where that leaves me!
Keith Humm
ya, my first guess was qp until I read the example.
sfossen
A: 

I had a similar issue, but mine was a little different. Since I stumbled upon this thread looking for the answer and it helped me find it, I thought I may as well post this related answer here.

In my case special characters were getting messed up in emails even through the actual mb_detect_encoding of the text strings being sent was "UTF-8" and if I echoed them they looked fine.

So I had to us the function

$message->setTextCharset('UTF-8')

and

$message->setHTMLCharset('UTF-8')
Aditya Advani