send mail with Chinese Word

A

Anonymous

Guest
Good day,

why my chinese word didn't display correctly in my email.

This is my code

Code:
$to = $email;
$header .= "From: Admin ";
$header .= 'Content-Type: text/html; charset=UTF-8' ."\n";
$subject ="Your Quotation";
$contents ="This is your references number and password , use this references number and password to check back your quotation
References No : $ruj
Password      : $password

$text
                        Grand Total : RM $grandtotal
-----------------------------------------------------

Thank You

Regards,
Admin";

if($contents != "")
{
   //send mail - $subject & $contents come from surfer input
   mail($to, $subject, $contents, $header);
   // redirect back to url visitor came from
//   header("Location: $HTTP_REFERER");
}
  
header("location:sendmail.php?randomid=$randomid");
?>

is that something wrong with my code :(

zai
 
sorry..maybe my title is wrong...
acctually the chinese word in the database... so i will achieve data from database..

Code:
$to = $email;
$header = "From: Admin ";
$header .= 'Content-Type: text/html; charset=UTF-8' ."\n";
$subject ="Your Quotation";$contents ="This is your references number and password , use this references number and password to check back your quotation
References No : $ruj
Password      : $password

$text

$text = (from database and contain a chinese character)

my problem is , in my email all the chinese character didn't display correctly...it show something like this --> å°
 
Can you place here some chinese line of text as well as english version of it.

So I can check out where is the problem.

We all are here to help each other so dont wory your problem will be solved here.
 
mmmm.. i got problem to explain my problem....

This is the email that i get :-


This is your references number and password , use this references
number and password to check back your quotation
References No : 21
Password : 2hjqocs7


1) Brand : HITACHI

Category : Computer

Sub Category : Hard Disk / 硬盤

Part number : HD104

Size = 120 GB

纖度 : 120 字節


Grand Total : RM 200
-----------------------------------------------------



but acctually i must get email like this :-



This is your references number and password , use this references
number and password to check back your quotation
References No : 21
Password : 2hjqocs7


1) Brand : HITACHI

Category : Computer

Sub Category : Hard Disk / 硬盤

Part number : HD104

Size = 120 GB

纖度 : 120 字節


Grand Total : RM 200
-----------------------------------------------------



can u help me :help:
 
that why...i dont't know how to set UTF-8 for mail..

can u help me... :?
 
Oh u have used it in your code

$header .= 'Content-Type: text/html; charset=UTF-8' ."\n";


it should work. try UTF-16 otherwise many experienced people here. They will definitely help u. :)
 
Back
Top