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.

    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

      This I am doing it for a news website. What they want to do is send latest news to all their subscriber.

      So basically , first I run mysql query, get data from mysql tables, once i get all news data for latest news using mysql query and php then i use a while loop to send it to each subscriber one by one by using the form given above. So file is not saved at all anywhere.

      Its all the script getting news from mysql tables and emailing to each register users one be one.

      However in the php script file i am using is set utf-8 on the top header meta tag. and if i want to check what is displaying on web page and echo that result by using echo $message; then it displays exact arabic text.

        I am no expert or anything, I just had some similar problems, so I thought I could give you a little of what I have learned.

        All I know is the fallowing: a file saved as UTF-8 can display Arabic text (on win2k standard western settings). It worked for me, I hoped it could be some help to you.

        Another thing, I took some of your text and pasted it in a document UTF-8 format and tried to view it in my browser. The document was UTF-8 and I viewed the page as UTF-8, and Arabic (ISO, IBM, Win) yet it all looked scrambled. - If that tells you something.

        Oh, and search this site for >non-English characters< there have been many threads regarding this issue, I do not know if you will find anything that will help you, but it could be worth a try.

        Good luck!

          With saving files i can manage. but problem is in sending emails. so something wrong probaly in server settings. thanks anyway

            $headers = 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

            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.

              ManWithNoName wrote:

              Hi again.

              Have you looked at the functions that are available at: http://se2.php.net/manual/en/ref.mbstring.php
              ?

              Thanks, you been realy helpful. I am also not a very good programmer. I have searched alot and it seems to me problem in encoding and decoding. This problems seems to me sort out if i use phpmailer classes and change charset setting in there. So i am thinking to install phpmailer classes. I have never done phpmailer classes setup but will try to figure it out.

              thanks again for your help.

                4 years later

                I know this is too late, any how I was looking for the same issue and I hope to help someone by writing this.

                In order to read Arabic text in your email that been sent from php email, do this:

                1. change the charset to "charset=utf-8"
                  $headers = "MIME-Version: 1.0" . "\r\n";
                  $headers .= "Content-type: text/html; charset=utf-8" . "\r\n";

                2. Go to your email "Options" (i.e. Outlook) and change the "international option" on "Mail Format" to UTF-8.

                This is what I have experienced and it worked for me.

                If the receipents' emails are web mails, this should not be a problem for them.

                by the way, on that php page that you are using to send those emails, please use this header:
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                <meta http-equiv="Content-Language" content="ar">

                Hope you the best
                Shamsieh

                  carsale, I think what ManWithNoName was saying was that the PHP script file itself needed to be saved as UTF8. There is a little bit of a problem with this sometimes.

                  Also, were you able to send a test email to several different email clients? I use Evolution and it is able to display more different character and symbols in emails than Outlook for example. Also, Gmail handles them better than Hotmail for instance, so you may get the results you want in a different email client, which would give you an idea where the problem is.

                    Write a Reply...