有没有办法设置PHP mail()的优先级?我查看了在线手册,但我找不到任何参考.
优先级,我的意思是标题中的高,正常,低或1,2,3.所以收件人知道邮件的紧急程度.
谢谢!
tan*_*jir 59
这通常通过在标题中设置以下字段来完成:
请参阅以下示例(摘自php的邮件功能文档):
<?php
$headers = "MIME-Version: 1.0\n" ;
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$headers .= "X-Priority: 1 (Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: High\n";
$status = mail($to, $subject, $message,$headers);
?>
Run Code Online (Sandbox Code Playgroud)
<?php
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$headers .= "X-Priority: 1 (Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: High\n";
$status = mail($to, $subject, $message, $headers);
?>
Run Code Online (Sandbox Code Playgroud)
来自:http://www.php.net/manual/en/function.mail.php#91058