Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Imapengine Laravel Package

directorytree/imapengine

IMAPEngine is a Laravel-friendly PHP package for working with IMAP mailboxes. Connect to servers, list folders, fetch messages and attachments, search and manage mail, and handle common IMAP operations through a clean, high-level API.

View on GitHub
Deep Wiki
Context7

directorytree/imapengine is a Laravel-friendly IMAP client for reading and processing email from any IMAP server with a clean, modern API. It helps you connect to mailboxes, fetch messages, and work with folders and attachments while fitting neatly into typical Laravel workflows.

Built for reliability and developer ergonomics, it streamlines common IMAP tasks so you can focus on automation, syncing, and inbound email processing.

  • Connect & authenticate to IMAP servers with configurable accounts
  • Browse mailboxes/folders and query messages efficiently
  • Read headers, bodies, and attachments with convenient helpers
  • Manage message state: flags, move, copy, delete
  • Laravel-style configuration and easy integration into apps/jobs
Frequently asked questions about Imapengine
Can I use ImapEngine in Laravel without the PHP IMAP extension?
Yes, ImapEngine is a pure PHP implementation and doesn’t require the PHP IMAP extension. This makes it portable across environments like Docker, serverless, or platforms without native IMAP support.
How do I connect to an IMAP server like Gmail or Office 365?
Configure your connection via Laravel’s config files or environment variables. Use the `ImapClient` class with credentials (host, port, SSL, username, password) and authenticate. Example: `$client = new ImapClient(['host' => 'imap.gmail.com', 'ssl' => true, ...]);`
Does ImapEngine support searching messages by date, size, or flags?
Yes, it supports advanced IMAP search criteria like `SENT SINCE`, `LARGER`, `SMALLER`, and flags (e.g., `\Seen`, `\Flagged`). Use methods like `$folder->search(['SINCE' => '15-Oct-2023'])` for filtering.
How do I handle attachments from IMAP messages in Laravel?
Attachments are parsed into `Attachment` objects with metadata (filename, MIME type, size). You can save them manually to Laravel storage (e.g., `Storage::disk('s3')->put()`) or process them in-memory. No built-in storage integration exists—custom logic is required.
Is ImapEngine compatible with Laravel 10 and PHP 8.2+?
Yes, ImapEngine supports modern PHP (8.1+) and Laravel 9/10. It uses type safety (e.g., `BackedEnum`) and PHPStan compliance. Check the package’s `composer.json` for exact version requirements.
Can I use ImapEngine for real-time email processing (e.g., webhooks)?
ImapEngine supports polling (`$folder->poll()`) and idle operations, but real-time processing requires persistent connections. For Laravel, consider wrapping it in a queue job (e.g., Horizon) or using Laravel Echo for push notifications.
How do I manage multiple IMAP accounts or connection pooling?
ImapEngine doesn’t include built-in pooling, but you can manually manage connections via Laravel’s service container (e.g., `singleton` or `contextual binding`). For high concurrency, use a container like `pimple/di` or a dedicated IMAP client wrapper.
Are there alternatives to ImapEngine for Laravel IMAP support?
Alternatives include `spatie/laravel-imap` (Laravel-specific wrapper) or raw PHP’s `imap_*` functions. ImapEngine stands out for its pure PHP implementation, modern API, and Laravel ecosystem alignment (e.g., Collections, Carbon).
How do I debug IMAP connection issues or malformed emails?
Use `spatie/ray` or Laravel Telescope to log IMAP operations. For malformed emails, validate with `nesbot/carbon` for dates or `symfony/mime` for headers. Handle exceptions like `ImapConnectionFailedException` with retry logic.
Does ImapEngine support server-side sorting or bulk operations?
Yes, it supports server-side sorting (e.g., `SORT DATE`) and bulk actions like flagging or deleting messages. For large datasets, use lazy loading (`$folder->messages()->limit(100)`) to avoid memory issues.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport