View Full Version : Help:mail contents arabic

08-31-2009, 09:28 AM
I make a arabic form that in UTF-8 unicode but, when I upload to and try to send it comes diffrent characters, I give my codes here :

if (isset($_POST['submitted']))
$errors = array();
if (empty($_POST['name']))
$errors[] = '<b>.تسجيل الاسمك</b><br>Enter your Name.';}
if (empty($_POST['email']))
$errors[] = '<b>.تشجيل بريدك </b><br>Enter your Email.';}
if (empty($_POST['subject']))
$errors[] = '<b>.العنوان </b><br>Enter Subject.';}

if (empty($errors)) {
$body = 'Name: ' . $_POST['name'] . "\r\n" .
'Email:' . $_POST['email'] . "\r\n" .
'Subject:' . $_POST['subject'] . "\r\n" .
'Comments:' . "\r\n" . $_POST['comments']. "\r\n" . "\r\n" . "\r\n" . "\r\n" .
'This Quiry from ShowerTan website.';
mail ('alex7gr8@aol.com', $_POST['subject'], $body);

echo '<h4 id="mainhead" align="center"><font color="#003399">' . $_POST['name'] .'! شكراََ </font></h4>
<p>Your Comments are sent. <br />We will reply you at <font color="#FFFF00"><u>' . $_POST['email'] .'</font></u> soon.</p>
<p><br /></p>'; }
echo '<h4 id="mainhead">Error!</h3>
<p class="error">The following error(s) occurred:<br />';
foreach ($errors as $msg)
echo " - $msg<br />\n";}
echo '</p><p>Please go back and try again.</p><p><br /></p>';}
} else {
<form action="1.php" method="post" dir="rtl">
<p align="center">
اسمك: <input type="text" name="name" size="20" maxlength="40"></p>
<p align="center">
بريدك: <input type="text" name="email" size="20" maxlength="40"> </p>
<p align="center">
عنوان الرسالة:
<input type="text" name="subject" size="20" maxlength="40"></p>
<p align="center">
نص الرســـــالة:
<textarea name="comments" cols="27" rows="4"></textarea></p>
<p align="center"><input type="submit" name="submit" value="ارسال"></p>
<input type="hidden" name="submitted" value="TRUE">

and the mail got when I fill this form in arabic like:

Name: ا†Šس Email:شس
Subject:ش Comments: شسŠش شس ثŠص

This Quiry from ShowerTan website.

please fix this problem

08-31-2009, 10:10 AM
Try this:

$header = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain; charset=UTF-8';

mail ('alex7gr8@aol.com', $_POST['subject'], $body, $header);

09-01-2009, 07:42 AM
Thanks Mr. Jason,

its working now ( I make the page property arabic(windows), hotmail using for mailing n there also select the character set Arabic(windows) and browser is still UTF-8.

but the final fight remains, the subject of mail is still ‏ (coming like tht).
suggest me, I am also trying for fix it.

Thanks again for giving the time for my questions.