PHP Mail标头
发布时间:2020-12-13 22:05:13 所属栏目:PHP教程 来源:网络整理
导读:我的代码: $to = 'example@example.com';$subject = $_REQUEST['subject'] ;$message = $_REQUEST['message'] ;$header = "From: noreply@example.comrn"; $header.= "MIME-Version: 1.0rn"; $header.= "Content-Type: text/html; charset=ISO-8859-1r
我的代码:
$to = 'example@example.com'; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; $header = "From: noreply@example.comrn"; $header.= "MIME-Version: 1.0rn"; $header.= "Content-Type: text/html; charset=ISO-8859-1rn"; $header.= "X-Priority: 1rn"; mail($to,$subject,$message,$header); 当我发送带有特殊字符的邮件时,例如?e-??-‘“?,?e??, 提前致谢! 解决方法
如果您设置此标头意味着您必须向用户发送HTML.您可以决定使用像TinyMCE这样的东西让用户在Word样式的编辑器中编写消息并使用它的HTML输出.或者将标题设置为纯文本.
编辑:试试这个 $to = 'example@example.com'; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; $header = "From: noreply@example.comrn"; $header.= "MIME-Version: 1.0rn"; $header.= "Content-Type: text/plain; charset=utf-8rn"; $header.= "X-Priority: 1rn"; mail($to,$header); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |