php ฟอร์มส่งเมล์ ส่งไปที่เมล์แล้วอ่าน title ไม่รู้เรื่อง

เริ่มโดย greenhead, 23 มกราคม 2012, 10:38:01

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

greenhead

php ฟอร์มส่งเมล์ ต้อง set character ภาษาไทยยังไงครับ?

ขอบคุณครับ  :wanwan017:

kw4nguru

$strTo = "[email protected]";
$strSubject = "=?UTF-8?B?".base64_encode("รายการใบสั่งซื้อเลขที่ $order_id")."?=";
$strHeader .= "MIME-Version: 1.0' . \r\n";
$strHeader .= "Content-type: text/html; charset=utf-8\r\n";
$strHeader .= "From: [email protected]<[email protected]>\r\nReply-To: [email protected]";

barbies55

รับทำเทมเพลท รับโมเทมเพลทให้เข้ากับสคริปต์ต่างๆ


On the Internet, Never One Know You are a Dog.
ผ้าขี้ริ้วห่อทองย่อมเป็นทองฉันใด เอาทองเปลวมาห่อขี้ก็ยังเป็นขี้ฉันนั้น

greenhead

ตอนนี้ title อ่านเป็นไทยละครับ แต่ข้อความยังเป็นตัวยึกยืออยู่ครับ

โค้ดตามนี้ครับ

<?php

$MyMail 
"[email protected]";
$MailTo $MyMail;
$MailFrom $_POST['MailFrom'] ;
$MailSubject $_POST['MailSubject'] ;
$MailMessage $_POST['MailMessage'] ;

$Headers "MIME-Version: 1.0\r\n" ;
$Headers .= "Content-type: text/html; charset=windows-874\r\n" ;
$Headers .= "From: ".$MailFrom." <".$MailFrom.">\r\n" ;
$Headers .= "Reply-to: ".$MailFrom." <".$MailFrom.">\r\n" ;
$Headers .= "X-Priority: 3\r\n" ;
$Headers .= "X-Mailer: PHP mailer\r\n" ;

if(
mail($MailTo$MailSubject $MailMessage$Headers$MailFrom))
{
echo 
"OK" ;
}else{
echo 
"SEND ERROR" ;
}

echo 
"<br><br>Back <a href='testmail.php'>Click</a>";

?>


ohmohm

อ้างถึงจาก: greenhead ใน 23 มกราคม 2012, 11:29:36
ตอนนี้ title อ่านเป็นไทยละครับ แต่ข้อความยังเป็นตัวยึกยืออยู่ครับ

โค้ดตามนี้ครับ ...

charset=windows-874 นิครับ $MailSubject อ่านได้ แต่ $MailMessage ไม่ได้ งั้นลอง iconv() ไหมครับ