php mail函数 subject乱码

    技术2022-05-20  53

    <?php /**  * mail 功能  */ function emailto($From, $To, $subject, $message) {    $headers  = "MIME-Version: 1.0/r/n";    $headers .= "Content-type: text/html; charset=UTF-8/r/n";    $headers .= "From: $From/nReply-To: $From/nX-Mailer: PHP/".phpversion();        $bool = mail($To, encodeMIMEString ("UTF-8", $subject), $message, $headers);    return $bool; } /**  * 信件標題編碼  */ function encodeMIMEString ($enc, $string) {    return "=?$enc?B?".base64_encode($string)."?="; } 


    最新回复(0)