绝对不乱码的中文邮件
function sendmail($to, $subject, $body) { $charset = "utf-8"; $email_from = "quwei@soften.cn"; //$headers = "From: $email_from\r\nReply-To: $email_from\r\nMIME-Version: 1.0\r\nContent-type: text/plain; charset=$charset\r\n"; $subject = "=?UTF-8?B?".base64_encode($subject)."?="; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "From: NiceWords <$email_from>" . "\r\n"; $headers .= "Reply-To: $email_from" . "\r\n"; $headers .= "Content-type: text/html; charset=$charset" . "\n"; $body .= " \r\n<br /><br />系统自动发送,请不好回复。 "; return mail($to, $subject, $body, $headers); }到顶部