Monday, May 24, 2010

How do you do html emails in a UTF8 character set using PHP? Does anyone have a fully worked example?

Eg, sending an html email containing both Chinese and Japanese characters.

How do you do html emails in a UTF8 character set using PHP? Does anyone have a fully worked example?
Hello,





Convert the text to HTML Entities.


This way it does not matter what character set you use.


The Chinese and Japanese characters will be dissplayed correctly in the rendered HTML. Paste the HTML Entities: in the source of the html file.





This works for emails sent to yahoo.com gmail and email clients.





Chinese original: 英吉利海峡诸岛


HTML Entities: 英吉利૲...





Japanese original: 英国全土から探す


HTML Entities: 英国全ࢶ...





to see what the HTML Entities: look like visit: http://www.greywyvern.com/code/php/utf8_...





Change to HTML Entities in the drop down box.
Reply:Try to use multipart/mixed header in php's email function. I think that could help with different coding in one email.


Good luck!


No comments:

Post a Comment