PHPackages                             nand2/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. nand2/php-imap

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

nand2/php-imap
==============

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

3.0.7(7y ago)053MITPHPPHP &gt;=5.5

Since Apr 20Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (27)Used By (0)

PHP IMAP
========

[](#php-imap)

[![Author](https://camo.githubusercontent.com/f18fdab5c2556c2a0d2b9a31b5dd50f9fa32ff758343d74601b0a744cd12c6db/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d4062617262757368696e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://www.linkedin.com/in/barbushin)[![GitHub release](https://camo.githubusercontent.com/9786a6c407d2fd3ac27d2a58a9f103cf986fb8a6704ef46d2108b64a9d7853b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f62617262757368696e2f7068702d696d61702e7376673f6d61784167653d3836343030267374796c653d666c61742d737175617265)](https://packagist.org/packages/php-imap/php-imap)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist](https://camo.githubusercontent.com/1e618d085297a77d76366549f657899f4a518c5849e5b79c9877189927035467/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d696d61702f7068702d696d61702e7376673f6d61784167653d3836343030267374796c653d666c61742d737175617265)](https://packagist.org/packages/php-imap/php-imap)

### Features

[](#features)

- Connect to mailbox by POP3/IMAP/NNTP, using [PHP IMAP extension](http://php.net/manual/book.imap.php)
- Get emails with attachments and inline images
- Get emails filtered or sorted by custom criteria
- Mark emails as seen/unseen
- Delete emails
- Manage mailbox folders

### Requirements

[](#requirements)

- IMAP extension must be present; so make sure this line is active in your php.ini: `extension=php_imap.dll`

### Installation by Composer

[](#installation-by-composer)

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

```

### Integration with frameworks

[](#integration-with-frameworks)

- Symfony -

### Usage example

[](#usage-example)

```
// 4. argument is the directory into which attachments are to be saved:
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', 'some@gmail.com', '*********', __DIR__);

// Read all messaged into an array:
$mailsIds = $mailbox->searchMailbox('ALL');
if(!$mailsIds) {
	die('Mailbox is empty');
}

// Get the first message and save its attachment(s) to disk:
$mail = $mailbox->getMail($mailsIds[0]);

print_r($mail);
echo "\n\nAttachments:\n";
print_r($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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 68.6% 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.

###  Release Activity

Cadence

Every ~57 days

Recently: every ~127 days

Total

26

Last Release

2594d ago

Major Versions

1.1 → 2.02015-04-20

2.2.5 → 3.0.02017-10-06

PHP version history (2 changes)1.0PHP &gt;=5.3.0

3.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ccbf29b3a12c9ab65eead50a80171416eb7d3f452b2cb9260e00ce6ae340060?d=identicon)[nand2](/maintainers/nand2)

---

Top Contributors

[![barbushin](https://avatars.githubusercontent.com/u/683352?v=4)](https://github.com/barbushin "barbushin (129 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (9 commits)")[![SRWieZ](https://avatars.githubusercontent.com/u/1408020?v=4)](https://github.com/SRWieZ "SRWieZ (8 commits)")[![stanma](https://avatars.githubusercontent.com/u/1821782?v=4)](https://github.com/stanma "stanma (5 commits)")[![JellyBellyDev](https://avatars.githubusercontent.com/u/190820?v=4)](https://github.com/JellyBellyDev "JellyBellyDev (4 commits)")[![dizzy7](https://avatars.githubusercontent.com/u/1052472?v=4)](https://github.com/dizzy7 "dizzy7 (3 commits)")[![nand2](https://avatars.githubusercontent.com/u/1593356?v=4)](https://github.com/nand2 "nand2 (2 commits)")[![pedrolopes10](https://avatars.githubusercontent.com/u/5683649?v=4)](https://github.com/pedrolopes10 "pedrolopes10 (2 commits)")[![georaldc](https://avatars.githubusercontent.com/u/286812?v=4)](https://github.com/georaldc "georaldc (2 commits)")[![Theaxiom](https://avatars.githubusercontent.com/u/57013?v=4)](https://github.com/Theaxiom "Theaxiom (2 commits)")[![tomhorvat](https://avatars.githubusercontent.com/u/7021695?v=4)](https://github.com/tomhorvat "tomhorvat (2 commits)")[![jlsalvador](https://avatars.githubusercontent.com/u/1464850?v=4)](https://github.com/jlsalvador "jlsalvador (2 commits)")[![norkunas](https://avatars.githubusercontent.com/u/2722872?v=4)](https://github.com/norkunas "norkunas (1 commits)")[![phansys](https://avatars.githubusercontent.com/u/1231441?v=4)](https://github.com/phansys "phansys (1 commits)")[![pixelpeter](https://avatars.githubusercontent.com/u/6502630?v=4)](https://github.com/pixelpeter "pixelpeter (1 commits)")[![temistokles](https://avatars.githubusercontent.com/u/1108659?v=4)](https://github.com/temistokles "temistokles (1 commits)")[![tonylegrone](https://avatars.githubusercontent.com/u/349645?v=4)](https://github.com/tonylegrone "tonylegrone (1 commits)")[![1allen](https://avatars.githubusercontent.com/u/597599?v=4)](https://github.com/1allen "1allen (1 commits)")[![Zayon](https://avatars.githubusercontent.com/u/3958468?v=4)](https://github.com/Zayon "Zayon (1 commits)")[![christianasche](https://avatars.githubusercontent.com/u/9271074?v=4)](https://github.com/christianasche "christianasche (1 commits)")

---

Tags

phpmailimappop3mailboxreceive emails

### Embed Badge

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

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

###  Alternatives

[php-imap/php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

1.7k12.9M42](/packages/php-imap-php-imap)[webklex/php-imap

PHP IMAP client

4365.5M14](/packages/webklex-php-imap)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3516.6k](/packages/benhall14-php-imap-reader)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)

PHPackages © 2026

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