PHPackages                             geerlingguy/imap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. geerlingguy/imap

ActiveLibrary

geerlingguy/imap
================

A PHP wrapper class for PHP's IMAP-related email handling functions.

1.0.0(6y ago)6025330MITPHP

Since Aug 23Pushed 2y ago7 watchersCompare

[ Source](https://github.com/geerlingguy/Imap)[ Packagist](https://packagist.org/packages/geerlingguy/imap)[ RSS](/packages/geerlingguy-imap/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![IMAP for PHP Logo](https://raw.githubusercontent.com/geerlingguy/Imap/1.x/Resources/Imap-Logo.png)](https://raw.githubusercontent.com/geerlingguy/Imap/1.x/Resources/Imap-Logo.png)

Imap
====

[](#imap)

A PHP wrapper class for PHP's IMAP-related email handling functions.

This class includes many convenience methods to help take the headache out of dealing with emails in PHP. For example, email handling method names make more sense (e.g. `getMessage`, `deleteMessage`, and `moveMessage` along with a message id, rather than passing around IMAP streams, using many difficult-to-remember `imap_*` functions).

Also, this class adds some convenient helpful information to emails, like the full message header (in `raw_header`), and whether or not the email was sent by an autoresponder (see `detectAutoresponder` for details).

If you have any issues or feature suggestions, please post a new issue on GitHub.

Usage
-----

[](#usage)

Connect to an IMAP account by creating a new Imap object with the required parameters:

```
$host = 'imap.example.com';
$user = 'johndoe';
$pass = '12345';
$port = 993;
$ssl = true;
$folder = 'INBOX';
$mailbox = new Imap($host, $user, $pass, $port, $ssl, $folder);
```

Get a list of all mailboxes:

```
$mailbox->getMailboxInfo();
```

Get an array of message counts (recent, unread, and total):

```
$mailbox->getCurrentMailboxInfo();
```

Get an associative array of message ids and subjects:

```
$mailbox->getMessageIds();
```

Load details for a message by id.

```
$id = 2;
$mailbox->getMessage($id);
```

Delete a message by id.

```
$id = 2;
$mailbox->deleteMessage($id);
```

Disconnect from the server (necessary after deleting or moving messages):

```
$mailbox->disconnect();
```

More methods and documentation can be found in the Imap.php class file.

License
-------

[](#license)

Imap is licensed under the MIT (Expat) license. See included LICENSE.md.

###  Health Score

32

↑

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1417 days

Total

2

Last Release

1038d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a45ed7a79658ff4cf1629167aee5777cb1d1a26595cb402ed1a4fdd7fb8891b0?d=identicon)[geerlingguy](/maintainers/geerlingguy)

---

Tags

emailimaplibrarymailpackagistphpphp-imapwrapper

### Embed Badge

![Health badge](/badges/geerlingguy-imap/health.svg)

```
[![Health](https://phpackages.com/badges/geerlingguy-imap/health.svg)](https://phpackages.com/packages/geerlingguy-imap)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
