PHP - How to read the importance (low normal high) on a imap server
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 '\n', 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.
精彩评论