dev-master
9999999-devSymfony2 service wrapper for PhpImap
MIT
The Requires
- php >=5.3.2
- symfony/symfony >=2.1
- php-imap/php-imap ~2.0
The Development Requires
email symfony imap
Symfony2 service wrapper for PhpImap
PhpImap integration via a Symfony service., (*1)
Install using composer by adding the following in the require
section of your composer.json
file:, (*2)
``` json "require": { ... "caponica/imap-bundle": "dev-master" },, (*3)
Register the bundle in your kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Caponica\ImapBundle\CaponicaImapBundle(), ); }
The bundle does not add a service to your project by default. To add the service, you will need to define the parameters and then the service itself., (*4)
``` yaml, (*5)
your_imap_config: imapPath: '{imap.gmail.com:993/imap/ssl}INBOX' username: you@gmail.com password: your_password directory: /path/to/folder, (*6)
``` yaml # services.yml caponica_imap_box: class: Caponica\ImapBundle\Service\CaponicaImap calls: - [ setConfig, [ %your_imap_config_box% ]]
To access the service, just reference it by the service name you defined above. E.g., from a controller:, (*7)
$caponicaImap = $this->container->get('caponica_imap_box'); $mailbox = $this->caponicaImap->getImapMailbox(); $mailsIds = $mailbox->sortMails(SORTDATE);
Symfony2 service wrapper for PhpImap
MIT
email symfony imap