Object-oriented PHP library for reading and processing emails over IMAP with a robust, fully tested API.
ddeboer/imap is a PHP library that provides an object-oriented interface for interacting with email servers via the IMAP protocol. It enables developers to programmatically manage mailboxes, search messages, handle attachments, and perform email operations with clean, testable code.
PHP developers building applications that need to interact with IMAP email servers, such as email clients, automation tools, or systems for processing incoming emails.
Developers choose this library for its robust object-oriented API that abstracts IMAP complexities, its mockable interfaces for easy testing, and its comprehensive features like attachment handling and embedded message support.
Object-oriented, fully tested PHP IMAP library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Encapsulates low-level IMAP functions into intuitive classes like Server, Connection, and Message, making code more readable and maintainable compared to procedural PHP imap_* calls.
Supports a wide range of operations including mailbox management, message search with expressions, attachment decoding, and embedded message parsing, as detailed in the README examples.
All core components implement interfaces, enabling easy mocking and unit testing without a live IMAP server, exemplified in the included MockabilityTest.
Indicated by CI badges, recent updates, and a clear Docker-based contribution process, ensuring reliability and ongoing support.
Requires PHP >= 8.4 and specific extensions (IMAP, iconv, mbstring), which may not be available in all hosting environments or require additional configuration.
Relies on PHP's IMAP extension, which has known issues like unsupported search criteria (e.g., OR) and global timeout settings, limiting flexibility without manual patches to the c-client library.
The README warns that spaces and double-quotes cannot be escaped together in search expressions, forcing developers to use RawExpression for complex queries, adding complexity.