Results 1 to 3 of 3

Thread: Help:mail contents arabic

  1. #1
    Join Date
    Jul 2007
    Location
    mumbai india
    Posts
    16
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Red face Help:mail contents arabic

    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 :



    PHP Code:
    <?php
    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>'
    ;    } 
            else 
            { 
                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">
            </form>
    <?php
        
    }
    ?>
    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
    Last edited by Snookerman; 08-31-2009 at 11:16 AM.

  2. #2
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Try this:

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

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

  3. The Following User Says Thank You to JasonDFR For This Useful Post:

    aneeselahi (09-01-2009)

  4. #3
    Join Date
    Jul 2007
    Location
    mumbai india
    Posts
    16
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    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.

    Alex

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •