下列為解決方法
代碼: 選擇全部
$MailTitle = '信件標題';
$MailFrom = '信件寄件者';
$MailTo = '信件收件者';
$MailTitle = '=?utf-8?B?'.base64_encode("$MailTitle").'?=';
$MailFrom = '=?utf-8?B?'.base64_encode("$MailFrom").'?='.'<mailfrom@mail.com.tw>';
$MailTo = '=?utf-8?B?'.base64_encode("$MailTo").'?='.'<mailto@mail.com.tw>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From:'.$MailFrom . "\r\n";
$MailMsg = 'mail測試'; // 信件內容
mail( $MailTo, $MailTitle, $MailMsg,$headers);