0

I have php code to send email in arabic but it is not working.

$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: DAC ";
$message .= '<html><body>';
$message .= '<table width="100%";>';
$message .= "<tr><td><img src='http://dgf.com/images/logo.png' alt='http://dacthatsmymom.com/' /></td></tr>";
$message .= "<tr style='height:10px;border:none'><td>&nbsp;</td></tr>";
$message .= "<tr><td colspan=2>Dear, Admin<br /><br />

<strong>Person Contact Detail: </strong><br/>
<strong>Name: </strong>".trim($_POST['name'])."<br/>
<strong>Email: </strong>".trim($_POST['email'])."<br/>
<strong>City #: </strong>".trim($_POST['city'])."<br/>
<strong>Address #: </strong>".trim($_POST['address'])."<br/>
<strong>Country#: </strong>".trim($_POST['country'])."<br/>
<strong>Selected Card#: </strong><a href='$cardimage'>Card Image</a><br/>
</td></tr>";
$message .= "<tr><td colspan=2 font='colr:#999999;'><br/><br/><strong><I>Dac<br>System Generated Email</I></strong></td></tr>"; 
$message .= "</table>";
$message .= "</body></html>";
        $sendEmail = mail('info@dffd.co.uk','Mdfdft', $message, $headers);

When the email get send I see the following in the email Person Contact Detail: Name: بيوم الأم م لتر Email: بيوم الأم لتر City #: بيوم دال لتر Address #: بيوم على رت لتر Country#: U.A.E.

Any help would be appreciated

aasd
  • 99
  • 1
  • 3
  • 7
  • 2
    I'm not sure if `ISO-8859-1` supports arabic, you might have to use UTF-8 instead (and that means your *entire code*, including headers in HTML/PHP/mail, should be set to UTF-8). I know UTF-8 supports it anyway. – Qirel Mar 20 '16 at 14:05
  • 1
    You need to change the character set, as stated above ^ – Funk Forty Niner Mar 20 '16 at 14:16

1 Answers1

0

As @Qirel said:

I'm not sure if ISO-8859-1 supports arabic, you might have to use UTF-8 instead (and that means your entire code, including headers in HTML/PHP/mail, should be set to UTF-8). I know UTF-8 supports it anyway.

You can also check this post for confirmation.

Community
  • 1
  • 1
Vincent G
  • 8,547
  • 1
  • 18
  • 36