PHP邮件() - 如何设置优先级? [英] PHP mail() - How to set Priority?

查看:159
本文介绍了PHP邮件() - 如何设置优先级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法设置PHP邮件()的优先级?我查看了在线手册,但我找不到任何参考。



按优先级,我的意思是高,正常,低或1,2,3在头。所以收件人知道邮件的紧急性。



谢谢!

解决方案

这通常是通过在标题中设置以下字段来完成的:




  • X-Priority(值从1到5从最高[1]到最低[5]),

  • X-MSMail-Priority(值:高,正常或低),

  • 重要性(值:高,正常或低)。



请参阅以下示例(取自php的邮件功能文档) :

 <?php 
$ headers =MIME-Version:1.0\\\
;
$ headers。=Content-Type:text / html; charset = \iso-8859-1\\\\
;
$ headers。=X优先级:1(最高)\\\
;
$ headers。=X-MSMail-Priority:High\\\
;
$ headers。=重要性:High\\\
;

$ status = mail($ to,$ subject,$ message,$ headers);
?>


Is there any way to set the priority of PHP mail()? I looked at the online manual but I can't find any reference to it.

By priority, I mean High, Normal, Low or 1, 2, 3 in the headers. So the recipient knows the urgency of the mail.

Thank you!

解决方案

That's usually done by setting following fields in the header:

  • "X-Priority" (values: 1 to 5- from the highest[1] to lowest[5]),
  • "X-MSMail-Priority" (values: High, Normal, or Low),
  • "Importance" (values: High, Normal, or Low).

See the following example (taken from php's mail function documentation):

<?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邮件() - 如何设置优先级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆