Forum Moderators: phranque

Message Too Old, No Replies

Email encoding problem

Quotable print, 7-bit, 8-bit or HTML?

         

tomda

5:38 am on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am having problem with special characters in emails I send using mail() function. I have been through my PHP books and found out that they are different solution.
1/ Encoding to 7-bit or 8-bit
2/ Using quotable_print
3/ Sending in HTML and using utf-8 encoding

Could you tell me what is the best option. Compatibility seems to be the main issue since emails should be the same on Yahoo, Gmail, Outlook and Lotus note.

Thank you

tomda

5:24 am on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sadly, I got no reply...

I have decided to opt for the last solution, that is a HTML email in UTF-8 encoding. It seems to be the most compatible and easiest solution.

coopster

3:05 pm on Oct 10, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Out of curiosity, how did you reach that decision, tomda?

I note that the PHP PEAR mime class uses 7bit encoding for plain text and quoted-printable for HTML by default. I haven't hit the RFC's yet to research any further but assume you have? If you have the time to share more information on how you reached your decision I would be interested.

tomda

7:53 am on Oct 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Coopster,

I changed my mind and decided to go for

Content-Type: text/plain; charset="utf-8";
Content-Transfer-Encoding: 8bit

although I am planning to have both text/html and text/plain (using boundaries)...

I am really not familiar with email so I can't really tell you why I have decided to use this one against quotable print. In fact, I was hoping to get some feedbacks here...

I had to say that I really struggled yesterday with special characters - for some special characters it works fine while for others it returns a blank email?.
Another main issue I had is that when a line in the textarea ends with ' or ", I get a blank email!

So, after a day of testing, I was very tired and decided to ban special characters (using regex)...

Sorry, can't tell you more but I am still working on it (I have five heavy forms to complete) and will report back if needed.

Thanks
Tomda