Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

send mail with Chinese Word

the mail() function

Moderators: macek, egami, gesf

send mail with Chinese Word

Postby zai » Wed Nov 16, 2005 5:19 pm

Good day,

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

This is my code

Code: Select all
$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
zai
New php-forum User
New php-forum User
 
Posts: 16
Joined: Fri Aug 19, 2005 12:20 am
Location: Malaysia

Postby php-vikas » Wed Nov 16, 2005 8:08 pm

Zai, I dont found any Chinese words in your code.
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby zai » Wed Nov 16, 2005 9:05 pm

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

Code: Select all
$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 --> å°
zai
New php-forum User
New php-forum User
 
Posts: 16
Joined: Fri Aug 19, 2005 12:20 am
Location: Malaysia

Postby php-vikas » Wed Nov 16, 2005 10:51 pm

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.
php-vikas
New php-forum User
New php-forum User
 
Posts: 164
Joined: Mon Apr 14, 2003 12:25 am
Location: India

Postby zai » Wed Nov 16, 2005 11:08 pm

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:
zai
New php-forum User
New php-forum User
 
Posts: 16
Joined: Fri Aug 19, 2005 12:20 am
Location: Malaysia

Postby Shiv » Thu Nov 17, 2005 12:39 am

Try to use UTF-8 charset in mail
User avatar
Shiv
php-forum Active User
php-forum Active User
 
Posts: 262
Joined: Wed Feb 02, 2005 8:06 pm
Location: Ahmedabad (Gujarat), INDIA

Postby zai » Thu Nov 17, 2005 12:55 am

that why...i dont't know how to set UTF-8 for mail..

can u help me... :?
zai
New php-forum User
New php-forum User
 
Posts: 16
Joined: Fri Aug 19, 2005 12:20 am
Location: Malaysia

Postby Shiv » Thu Nov 17, 2005 1:53 am

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. :)
User avatar
Shiv
php-forum Active User
php-forum Active User
 
Posts: 262
Joined: Wed Feb 02, 2005 8:06 pm
Location: Ahmedabad (Gujarat), INDIA

Postby zai » Thu Nov 17, 2005 5:43 pm

still not working...

it's give me same output...


:(
zai
New php-forum User
New php-forum User
 
Posts: 16
Joined: Fri Aug 19, 2005 12:20 am
Location: Malaysia


Return to PHP coding => Mail

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.