PHPackages                             attractgroup/php-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. [HTTP &amp; Networking](/categories/http)
4. /
5. attractgroup/php-imap

ActiveLibrary[HTTP &amp; Networking](/categories/http)

attractgroup/php-imap
=====================

PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension

09PHP

Since Sep 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/attract/php-imap)[ Packagist](https://packagist.org/packages/attractgroup/php-imap)[ RSS](/packages/attractgroup-php-imap/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ImapMailbox is PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension

### Features

[](#features)

- Connect to mailbox by POP3/IMAP/NNTP (see [imap\_open](http://php.net/imap_open))
- Get mailbox status (see [imap\_check](http://php.net/imap_check))
- Receive emails (+attachments, +html body images)
- Search emails by custom criteria (see [imap\_search](http://php.net/imap_search))
- Change email status (see [imap\_setflag\_full](http://php.net/imap_setflag_full))
- Delete email

### Installation by Composer

[](#installation-by-composer)

```
{
	"require": {
		"php-imap/php-imap": "~2.0"
	}
}

```

Or

```
$ composer require php-imap/php-imap ~2.0

```

### Migration from `v1.*` to `v2.*`

[](#migration-from-v1-to-v2)

Just add following code in the head of your script:

```
use PhpImap\Mailbox as ImapMailbox;
use PhpImap\IncomingMail;
use PhpImap\IncomingMailAttachment;

```

### [Usage example](https://github.com/barbushin/php-imap/blob/master/example/index.php)

[](#usage-example)

```
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', 'some@gmail.com', '*********', __DIR__);
$mails = array();

$mailsIds = $mailbox->searchMailBox('ALL');
if(!$mailsIds) {
	die('Mailbox is empty');
}

$mailId = reset($mailsIds);
$mail = $mailbox->getMail($mailId);

var_dump($mail);
var_dump($mail->getAttachments());
```

### Recommended

[](#recommended)

- Google Chrome extension [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef)
- Google Chrome extension [JavaScript Errors Notifier](https://chrome.google.com/webstore/detail/javascript-errors-notifie/jafmfknfnkoekkdocjiaipcnmkklaajd)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/56557828f324bb3df0192565a256ae764b220ffe76a1bf1e4f8b8a70e58a6805?d=identicon)[Attract Group](/maintainers/Attract%20Group)

---

Top Contributors

[![alexkimattract](https://avatars.githubusercontent.com/u/198036774?v=4)](https://github.com/alexkimattract "alexkimattract (3 commits)")

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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