大网数据广告活动
PHP 语言与运行手册

imap_headerinfo · Read the header of the message

· 52CE 我爱测

imap_headerinfo — Read the header of the message

imap_headerinfo

(PHP 4, PHP 5, PHP 7, PHP 8)

imap_headerinfo — Read the header of the message

说明

function imap_headerinfo(
    IMAP\Connection $imap,
    int $message_num,
    int $from_length = 0,
    int $subject_length = 0
): stdClass|false

Gets information about the given message number by reading its headers.

参数

imap

IMAP\Connection 实例。

message_num

The message number

from_length

Number of characters for the fetchfrom property. Must be greater than or equal to zero.

subject_length

Number of characters for the fetchsubject property Must be greater than or equal to zero.

返回值

Returns false on error or, if successful, the information in an object with following properties:

  • toaddress - full to: line, up to 1024 characters

  • to - an array of objects from the To: line, with the following properties: personal, adl, mailbox, and host

  • fromaddress - full from: line, up to 1024 characters

  • from - an array of objects from the From: line, with the following properties: personal, adl, mailbox, and host

  • ccaddress - full cc: line, up to 1024 characters

  • cc - an array of objects from the Cc: line, with the following properties: personal, adl, mailbox, and host

  • bccaddress - full bcc: line, up to 1024 characters

  • bcc - an array of objects from the Bcc: line, with the following properties: personal, adl, mailbox, and host

  • reply_toaddress - full Reply-To: line, up to 1024 characters

  • reply_to - an array of objects from the Reply-To: line, with the following properties: personal, adl, mailbox, and host

  • senderaddress - full sender: line, up to 1024 characters

  • sender - an array of objects from the Sender: line, with the following properties: personal, adl, mailbox, and host

  • return_pathaddress - full Return-Path: line, up to 1024 characters

  • return_path - an array of objects from the Return-Path: line, with the following properties: personal, adl, mailbox, and host

  • remail -

  • date - The message date as found in its headers

  • Date - Same as date

  • subject - The message subject

  • Subject - Same as subject

  • in_reply_to -

  • message_id -

  • newsgroups -

  • followup_to -

  • references -

  • Recent - R if recent and seen, N if recent and not seen, ' ' if not recent.

  • Unseen - U if not seen AND not recent, ' ' if seen OR not seen and recent

  • Flagged - F if flagged, ' ' if not flagged

  • Answered - A if answered, ' ' if unanswered

  • Deleted - D if deleted, ' ' if not deleted

  • Draft - X if draft, ' ' if not draft

  • Msgno - The message number

  • MailDate -

  • Size - The message size

  • udate - mail message date in Unix time

  • fetchfrom - from line formatted to fit from_length characters

  • fetchsubject - subject line formatted to fit subject_length characters

更新日志

版本 说明
8.1.0 现在 imap 参数接受 IMAP\Connection 实例,之前接受有效的 imap resource。
8.0.0 The unused defaulthost parameter has been removed.

参见

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。