在 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
)
- 我正在做的事情是否会导致它被“读取”?
- 我怎么知道这是一条“新”消息。
谢谢,埃德