我正在将这些库用于我正在构建的电子邮件应用程序。
$storage = new Zend_Mail_Storage_Imap($imap);
if (strpos($storage->getMessage($i),'chocolate') !== FALSE )
{
//Move to chocolate folder here
}
此外,有没有办法从现在开始将来自该发件人的传入电子邮件自动放入巧克力文件夹中? ...类似于如何在 gmail 中构建标签,并且来自该发件人的所有邮件将来都会自动进入该文件夹。
我对 zend 还很陌生,我要再次重新查看文档。
最佳答案
这确实有点棘手。
$storage = new Zend_Mail_Storage_Imap($imap);
if (strpos($storage->getMessage($i),'chocolate') !== FALSE ){
//Move to chocolate folder here
$messageUniqueId = $storage->getUniqueId($i);
$currentMessageId = $storage->getNumberByUniqueId($messageUniqueId);
$storage->moveMessage($messageUniqueId, 'chocolate');
}
关于php - 如何使用 zend_mail 和 zend_mail_storage_imap 将电子邮件移动到不同的文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4026647/