PHP中的自定义IMAP命令 [英] Custom IMAP command in php

查看:131
本文介绍了PHP中的自定义IMAP命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

php中Java imap函数doCommand的替代方法是什么?

What is alternative of java imap function doCommand in php ?

我想触发一些自定义imap扩展命令,但在这里找不到任何功能: http://php.net/manual/en/book.imap.php

I want to fire some custom imap extension command but I don't find any function to do that here: http://php.net/manual/en/book.imap.php

推荐答案

我已切换到zend imap. 它支持自定义命令和提取.

I have switched to zend imap. it supports custom command and fetch.

解决了我的问题.

<?php
require_once 'Zend/Mail/Storage/Imap.php';
require_once "Zend/Mail/Protocol/Imap.php";
require_once "Zend/Registry.php";
$protocol = new Zend_Mail_Protocol_Imap('imap.gmail.com', 993, true);
$protocol->login($user, $pass);
$protocol->select('INBOX');
$storage = new Zend_Mail_Storage_Imap($protocol);
foreach ($storage as $messageId => $message) {
  $id = $protocol->fetch('Custom Attribute', $storage->getUniqueId($messageId));
  echo "Mail from '{$message->from}': {$message->subject} : Custom Attribute $id \n";
}
?>

这篇关于PHP中的自定义IMAP命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆