绝对不乱码的中文邮件

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);
}
php/php_sendmail.txt · 最后更改: 2010/03/09 02:03 由 kenvin
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0 红麦软件 红麦软件