digitalshift / mailbox-connection-bundle
A Symfony2 Bundle mailbox communication by imap/pop3.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=5.3.0
- ext-imap: *
- ext-mailparse: *
This package is not auto-updated.
Last update: 2025-03-29 16:59:42 UTC
README
- encapsulates IMAP/POP3/… connections
- provides abstraction layer for MimeMessages / Mailbox-Folders
- depends on PECL/mailparse Library
Supported Mailbox Connections / Protocols
- IMAP (ImapConnector)
- POP3 (Pop3Connector) - not yet implemented
Abstraction-Layer
Mailbox - Folder
- access to mailbox folders, including their intire messages and subfolders (self-referencing)
- see Entity/Folder.php for complete fieldlist
MimeMessage
- access to mails, including raw content (mime-parts) & headers
- see Entity/MimeMessage.php for complete fieldlist
Installation / Configuration
- install doc see: installation-chapter
- configuration doc see: configuration-chapter
Basic Usage
The main access point is the digitalshift_mailbox_client.connector
-service. It encapsulates your mailbox-connection and internally uses factories to build Folder- and MimeMessage-instances by the recieved mailbox data. In your controller (for example), you can do things like that:
class DefaultController extends Controller { ... public function indexAction() { /** @var ImapConnector $imapConnector */ $imapConnector = $this->get('digitalshift_mailbox_client.connector'); $folder = $imapConnector->getFolder(); // OR $folder = $imapConnector->getFolder('INBOX'); $message = $imapConnector->getMessage(1); // OR $message = $imapConnector->getMessage(1, 'INBOX'); // Folder $folder->getName(); $folder->getPath(); $folder->getMessages(); $folder->getFolders(); // Message $message->getHeader(); $message->getContent(); $message->getSubject(); $message->getHtmlContent(); $message->getPlainContent(); return $this->render( 'DigitalshiftMailerBundle:Default:index.html.twig', array( 'message' => $message, 'folder' => $folder ) ); } ... }