PHP - 如何读取imap服务器上的重要性(低正常高)

I've been playing with the PHP's awesome imap capabilities.. I'm curious how I can read the importance level of an email.. is there a way to get which email was sent as High?

Thank you!

-Henry

you can use the imap_headerinfo() function to get the header of a message and you can read the importance of message by reading header info.

http://php.net/manual/en/function.imap-headerinfo.php

Call imap_fetchheader(). Explode the header on ' ', then massage the resulting data by joining any of the resulting lines that begin with a space or tab character back into the previous line (RFC 5322 header folding).

You'll want the values of the Importance and X-Priority headers. An X-Priority of "1" or "2" translates into high importance; a value of "4" or "5" is low importance. Likewise, an Importance of "high" or "low" should be self-explanatory.