What is alternative of java imap function doCommand
in 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
What is alternative of java imap function doCommand
in 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
I have switched to zend imap. it supports custom command and fetch.
which solved my problem.
<?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
";
}
?>