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

A fully-featured IMAP library -- without the PHP extension

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai