如何使用 PHP IMAP 切换 pop3 邮箱的文件夹
我很确定 PHP IMap 库完全支持 pop3 收件箱,但我无法找到收件箱以外的文件夹。是否可以使用 php imap 库收集 pop3 电子邮件的其他文件夹?
这是我用来测试的函数
function allFolderMailCount($connection,$server)
{
$list = imap_getmailboxes($connection, $server, "*");
if (is_array($list))
{
foreach ($list as $key => $val)
{
$folderEmails .= $val->name . ' ---- ' . email_folder_count($connection, $val->name);
}
}
else
{
$folderEmails .= "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
return $folderEmails;
}
I'm pretty sure there's full support for pop3 inboxes in the PHP IMap library, but I'm not able to find folders other than the inbox. Is it possible to gather other folders using php imap library for pop3 emails?
Here's the function I'm using to test
function allFolderMailCount($connection,$server)
{
$list = imap_getmailboxes($connection, $server, "*");
if (is_array($list))
{
foreach ($list as $key => $val)
{
$folderEmails .= $val->name . ' ---- ' . email_folder_count($connection, $val->name);
}
}
else
{
$folderEmails .= "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
return $folderEmails;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
POP3 没有“文件夹”的概念。因此你想做的事情是不可能的。如果您需要文件夹支持,请切换到 IMAP 协议。
POP3 does not have the notion of "folders". What you want to do is therefore impossible. Switch to the IMAP protocol if you need support for folders.