douwen1213
2015-01-21 09:05 浏览 116
已采纳

获取gmail的所有邮箱时都会收到此警告

Notice:  Unknown: [NONEXISTENT] Unknown Mailbox: [Gmail] (Failure) (errflg=2) in Unknown on line 0

no idea why I am getting this notice. I used

$mbox=imap_open("{imap.gmail.com:993/imap/ssl}", $username, $password);
$list = imap_getmailboxes($mbox, "{imap.gmail.com:993/imap/ssl}", "*");

to fetch all gmail folders.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答 默认 最新

  • 已采纳
    duangangpin078794 duangangpin078794 2015-01-21 11:05

    If you send a LIST command to list all mailboxes, the entry for [Gmail] says:

    * LIST (\HasChildren \Noselect) "/" "[Gmail]"
    

    That is, this mailbox cannot be selected (\Noselect).

    I'd guess that imap_getmailboxes doesn't care about the \Noselect flag and tries to select that mailbox anyway.

    点赞 评论 复制链接分享

相关推荐