I have this PHP file that gets info from a HTML form in my website and then send that info to my mail. ( Contact Form )
the thing is that my site is in Hebrew and the info that the client is inserting to the form is in Hebrew. the problem is when i get the mail its in Jibrish....
I have tried all encoding possible,
Mayb someone here can solve this problem for me.
I have to mantion that the host fully support Hebrew and RTL lang.
the code:
Code: Select all
<?php
ini_set("SMTP","******");
ini_set("UserName","*******");
ini_set("Password","****");
$subject = "New Message From *****";
$myMail = "bla@inc.com";
$sentFrom = $_REQUEST['mail'];
$senderName = $_REQUEST['name'];
$senderPhone = $_REQUEST['phone'];
$content = $_REQUEST['comments'];
$headers = "From: $sentFrom\r\n";
$headers .= "MIME-Version: 3.1\r\n";
$headers .= "Content-languege: hw\r\n";
$headers .= "Content-type: text/html; charset=utf-8"; //* I have tried Hebrew Window charset doesnt work *//
$emailbody =<<<EOD
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> //* same as above *//
<meta http-equiv="Content-language" content="he"/>
<body>
?? ?????:$senderName <br><hr>
???? ?????: $senderPhone <br>
<hr><br>
???? ??????: <br>
$content <br>
EOD;
$success = @mail($myMail, $subject, $emailbody, $headers);
echo $success ? "Mail Sent" : "Mail Failed";
?>
<html>
<head>
<script langauge=Javascript>
//window.close();
</script>
</head>
<body>
<Br><Br><Br><Br><Br><Br>
<center>
<h2><font color=#22A2A5>?????? ????? ??????.</font></h2>
<br>
<A onMouseOver="this.style.cursor='hand';"><h4 onClick="window.close();">???? ????.</h4></a>
</center>
</body>
</html>Thanks in advance
Ran.