close
只要在信件的標頭欄位中添加文件型態及字元集(charset)資訊,
如 'Content-type: text/html; charset="big5"' 即寄發有
html tag的中文郵件。
範例如下:
require 'MyMailer.php';
$mailTo = 'your@example.com'; // 請自行替換有效的收件地址
$message = 'test 測試'; // 請自行替換有效的訊息(可包含html tag)
$subject = 'TEST 測試'; // 請自行替換有效的標題
$headers = 'Content-type: text/html; charset="big5"' . "\r\n";
$headers .= 'From:Name
mail($mailTo, $subject, $message, $headers);
MyMailer::mail($mailTo, $subject, $message, $headers);
?>
全站熱搜
留言列表