You are browsing documentation for version 5.0 of OroCommerce, OroCRM, and OroPlatform, maintained until August 2024 and supported until March 2026. See version 5.1 (the latest LTS version) of the Oro documentation for information on latest features.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Usage Example

// Preparing connection config
$imapConfig = new ImapConfig('', 993, 'ssl', 'user', 'pwd');

// Accessing IMAP connector factory
/** @var ImapConnectorFactory $factory */
$factory = $this->get('oro_imap.connector.factory');

// Creating IMAP connector for the ORO user
$imapConnector = $factory->createImapConnector($imapConfig);

// Creating IMAP manager
$imapManager = new ImapEmailManager($imapConnector);

// Creating the search query builder
$queryBuilder = $imapManager->getSearchQueryBuilder();

// Building a search query
$query = $queryBuilder

// Request an IMAP server for find emails
$emails = $imapManager->findItems($query);

// Creating IMAP folder manager
$imapFolderManager = new ImapEmailFolderManager($imapConnector);

// Getting IMAP folders
$folders = $imapFolderManager->getFolders(null, true);