จู่ๆบอร์ดเราก็มีปัญหาเรื่อง Subject อีเมล์ ที่ภาษาไทยเพี้ยน
นะครับ เลยไปหาวิธีแก้มา เจอวิธีดีๆ เลยขออนุญาตคัดลอกมาเผื่อเป็นประโยชน์ต่อผู้ที่กำลังเจอปัญหานี้อยู่ครับ
ที่มาจาก :
http://www.justusers.net/forum/index.php?topic=4970.0SMF ส่ง Email ไป Homail,Yahoo แล้วผู้ส่งและหัวข้อภาษาไทยอ่านไม่ออก
เชื่อว่าหลายคนคงเจอปัญหานี้แล้วแล้วแก้ไม่ได้สักทีแก้ปัญหาโดย เปิดไฟล์
Sources/Subs-Post.phpค้นหาบรรทัด
// Sadly Hotmail & Yahoomail don't support character sets properly.
(อยู่ประมาณบรรทัดที่ 540)
ให้ลบโค๊ดต่อไปนี้ทิ้ง
// Sadly Hotmail & Yahoomail don't support character sets properly.
if ($hotmail_fix === null)
{
$hotmail_to = array();
foreach ($to_array as $i => $to_address)
{
if (preg_match('~[แอท](yahoo|hotmail)\.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)
{
$hotmail_to[] = $to_address;
$to_array = array_diff($to_array, array($to_address));
}
}
// Call this function recursively for the hotmail addresses.
if (!empty($hotmail_to))
$mail_result = sendmail($hotmail_to, $subject, $message, $from, $message_id, $send_html, $priority, true);
// The remaining addresses no longer need the fix.
$hotmail_fix = false;
// No other addresses left? Return instantly.
if (empty($to_array))
return $mail_result;
}
หรือเพิ่ม /*___________*/ เพื่อให้โค๊ดดังกล่าวไม่ทำงาน ดังนี้// Sadly Hotmail & Yahoomail don't support character sets properly.
/*if ($hotmail_fix === null)
{
$hotmail_to = array();
foreach ($to_array as $i => $to_address)
{
if (preg_match('~[แอท](yahoo|hotmail)\.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)
{
$hotmail_to[] = $to_address;
$to_array = array_diff($to_array, array($to_address));
}
}
// Call this function recursively for the hotmail addresses.
if (!empty($hotmail_to))
$mail_result = sendmail($hotmail_to, $subject, $message, $from, $message_id, $send_html, $priority, true);
// The remaining addresses no longer need the fix.
$hotmail_fix = false;
// No other addresses left? Return instantly.
if (empty($to_array))
return $mail_result;
}*/
Tip เล็กน้อยหาก Email ที่ส่งไปชอบลงถังขยะ
ให้ใช้อีเมล์ของเว็บมาสเตอร์(ผู้ดูแล>> ค่าต่างๆของระบบ>>อีเมล์ของเว็บมาสเตอร์) เป็น xxx[แอท]mydomain.com เช่น no-reply[แอท]mydomain.com