PHP mail() - 如何设置优先级?
有没有办法设置PHP mail()的优先级?我查看了在线手册,但我找不到任何参考资料。
通过优先级,我的意思是标头中的高,正常,低或1,2,3。因此,收件人知道邮件的紧迫性。
谢谢!
有没有办法设置PHP mail()的优先级?我查看了在线手册,但我找不到任何参考资料。
通过优先级,我的意思是标头中的高,正常,低或1,2,3。因此,收件人知道邮件的紧迫性。
谢谢!
这通常是通过在标头中设置以下字段来完成的:
请参阅以下示例(取自 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);
?> 
<?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); 
?>
 
				    		 
				    		 
				    		 
				    		