imap_header,recent = N,unseen =“”......但我还没读过

时间:2009-03-24 17:14:42

标签: php imap

在LeaseWeb服务器上使用PHP 5.2.0-8 + etch13,我有代码通过imap通过电子邮件处理通过电子邮件发送到某个地址的文件。我致电imap_open(检查错误而未找到任何错误),通过imap_num_msg获取消息数量,然后查看每个消息imap_header。所有运行都没有错误。

然后我检查if ('U' == $header->Unseen || 'N' == $header->Recent)。 这在ModWest共享服务器上使用相同的代码可以正常工作,但在Leaseweb和ModWest VPS服务器上应该找不到新消息。在运行代码之前发送的print_r测试电子邮件的标题显示为...

stdClass Object
(
    [date] => Tue, 24 Mar 2009 17:57:55 +0100
    [Date] => Tue, 24 Mar 2009 17:57:55 +0100
    [subject] => Data 200903
    [Subject] => Data 200903
    [in_reply_to] => <example@mail.gmail.com>
    [message_id] => <example@mail.gmail.com>
    [references] => <example@mail.gmail.com>  <example@mail.gmail.com>
    [toaddress] => data@example.com
    [to] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => data
                    [host] => example.com
                )

        )

    [fromaddress] => "me" <me@example.com> 
    [from] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => me
                    [mailbox] => me
                    [host] => example.com
                )

        )

    [reply_toaddress] => "me" <me@example.com> 
    [reply_to] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => me
                    [mailbox] => me
                    [host] => example.com
                )

        )

    [senderaddress] => me@gmail.com
    [sender] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => me
                    [host] => gmail.com
                )

        )

    [Recent] => N
    [Unseen] =>  
    [Flagged] =>  
    [Answered] =>  
    [Deleted] =>  
    [Draft] =>  
    [Msgno] =>    1
    [MailDate] => 24-Mar-2009 17:57:55 +0100
    [Size] => 8802
    [udate] => 1237913875
)
  1. 我正在做的事情导致这个“读”吗?
  2. 我怎么知道这是一个“新”的消息。
  3. 谢谢, 编

1 个答案:

答案 0 :(得分:0)

只是在黑暗中拍摄,但访问此其他类型服务器上的标头信息的特定方法是否可被解释为正在读取?