如何在utf8发送电子邮件 [英] How to send an email in utf8
本文介绍了如何在utf8发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在utf8编码中发送此电子邮件的消息。
i want to send message of this email in utf8 coding ..
我可以为此做些什么
include 'functions.php';
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);
$cap=strtoupper($_POST['cap']);
$error = '';
$mail = mail(WEBMASTER_EMAIL,$subject,$message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
我可以在utf8中发送什么?
what can i send this in utf8 ?
推荐答案
您可以在电子邮件标题中指定编码,如下所示:
You can specify the encoding in the email headers, like so:
$mail = mail(WEBMASTER_EMAIL,$subject,$message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."Content-type: text/html; charset=UTF-8\r\n"
."X-Mailer: PHP/" . phpversion());
这篇关于如何在utf8发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文