9

For some time now I've had the problem of some of my users getting =0A=0A instead of new lines in emails I send to them via PHP. Correspondence via email client works well, but PHP generated emails always look like this with some users (a minority). Googling revealed no decent results, all search results seem to be connected with outlook somehow - and it is unacceptable to think that all outlook users would suffer from this problem. Does anyone know a correct way of handling this and avoiding these new line encoding issues?

Edit: FYI I'm using Zend's Mailer class.

Thanks

Edit 2:

Changing the encoding type did not work. I encoded the headers to base64, and the body to 64, got garbled stuff. Then I tried with base64 headers, and did base64_decode(base64_decode($body)) on the body, and that was fine on the user's "CNR Server but not in the inbox" whatever that means. When I tried mb_convert_encoding to base64, I got the encoded string instead of the body again, so no use.

What else can I try? Zend Mailer only supports Quoted Printable and Base64 header encoding. Not sure what to do to the body for it to match the quoted printable encoding...

Swader
  • 11,387
  • 14
  • 50
  • 84
  • FYI that's a line break in quoted-printable encoding (although I thought emails were supposed to use CRLF i.e. =0D=0A) – Rup Mar 28 '11 at 11:42
  • hmm, sounds like a character-set encoding issue. – Spudley Mar 28 '11 at 11:42
  • 1
    @Rup Yeah, I know, just not sure how to fix it. I'm using Zend's mailer class. All the non-text characters are encoded, dashes become =C2=A0, etc. – Swader Mar 28 '11 at 11:46

1 Answers1

8

The email body has been encoded using quoted-printable - but the mime type declared in the email is text/html (or text/plain or undefined).

How you make the encoding of the body of the email match the mime header is up to you.

symcbean
  • 47,736
  • 6
  • 59
  • 94
  • I have sent a test mail to my troubled user with a force encoded header of base64, the only other default option of Zend_Mail. I'll post back as soon as I hear from them. – Swader Mar 28 '11 at 12:00
  • Users reported back, did not work. Any other ideas? I made a small update on the original question, so if you could shed some extra light, I'd be much obliged. – Swader Mar 30 '11 at 12:35