searchacar Posted August 1, 2007 Share Posted August 1, 2007 Hi, I been creating and sending emails from a ling time by the coding form given below, $to = $user_email; // subject $subject = 'helo'; // message $message = " <html> <head> <title> Account Activation Link</title> </head> <body> <table width='759'> <tr> <td>message here</td> </tr> </table> </body> </html> "; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; .................................. .................................. The above method is fine for sending emails in html and in english. But if i use same code to generate arabic word it give some charcters like this, " ان كانت الÙتاة التي معك اختك او زوجتك او اØ*د من اقاربك Ùلا تÙكر مرة اخرى ان تأتي بها الى هذا المكان ولا ÙÙŠ المطاعم الاخرى المنتشرة ÙÙŠ المنطقة الخضراء وما شاهدته هنا لا يساو٠" I have changed charset many time to arabic but could not reslove the issue and still get the same result. Note: I first do query some result from database, get the result and then send it using the above email forms. thanks any advice will be great. Quote Link to comment Share on other sites More sharing options...
Caesar Posted August 1, 2007 Share Posted August 1, 2007 Hopefully, you're not sending messages to some terrorist organization... What is the default character encoding on the server? And I could be wrong but, I believe that the character encoding on the receiving end also plays a part on whether it will be displayed properly. Quote Link to comment Share on other sites More sharing options...
searchacar Posted August 1, 2007 Author Share Posted August 1, 2007 I dont know about servers, but it gets fine in hotmail. probably there character encoding automatically get set. However problem seen in yahoo, and outlook express. It shows the message as i have posted the result above. I dont know how it comes ok in hotmail. I also noticed that if i copy and paste the whole arabic words then it goes to yahoo fine. But getting error when i directly get result from datbases and then send in email. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 2, 2007 Share Posted August 2, 2007 What is the character set for the database? I think arabic is a mulibyte character set, so if the database isn't prepared for it, it will mess up the encoding. http://dev.mysql.com/doc/refman/5.0/en/charset.html Quote Link to comment Share on other sites More sharing options...
searchacar Posted August 2, 2007 Author Share Posted August 2, 2007 CHARSET=latin1 set in databases. Also this works fine on the websites. all pages on website works ok, but problem is in sending email. Note: If i do query from database and echo the result on website page which shows ok but when submit this information in email then it shows characters as shown on top. However in outlook express it only works when we chages encoding. hope this will help to understand the issue. Quote Link to comment Share on other sites More sharing options...
searchacar Posted August 2, 2007 Author Share Posted August 2, 2007 can someone explain this bit, i think i am missing somthing here, " $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; " if i use charset=utf-8 on web page it shows arabic fine either i open web page in internet explores, or firfox etc but why not in emails when i put charset=utf-8 in above header and send email using same databases it shows the result in yahoo and outlook express as given below, " ان كانت الÙتاة التي معك اختك او زوجتك او اØ*د من اقاربك Ùلا تÙكر مرة اخرى ان تأتي بها الى هذا المكان ولا ÙÙŠ المطاعم الاخرى المنتشرة ÙÙŠ المنطقة الخضراء وما شاهدته هنا لا يساو٠" Is there something in browser over-riding. Or Is there I am missing any of field in header. What usually people use in header to support other languages. any suggestion, i am realy stuck. thanks Quote Link to comment Share on other sites More sharing options...
searchacar Posted August 3, 2007 Author Share Posted August 3, 2007 $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; It seems to me no reply from any senior members. If someone have knowledge of it can he/she explain this bit, i am realy stuck from few days. if i change charset in above line to utf-8 and then send email then it makes no changes and email shown always in strange characters like this "§Ù† كانت " whatever i change the charset on top two header line it makes no effect on emails. But why if i change charset in the browser then it makes changes in these characters. e.g if you change your encoding say to utf-8 from your browsers setting then probably you will notice these charcter will change into arabic words. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.