PHPackages                             rdx/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rdx/imap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rdx/imap
========

Reads and parses e-mail from an IMAP/POP3 source

2.8(6y ago)61051[2 issues](https://github.com/rudiedirkx/imap-reader/issues)MITPHP

Since Nov 20Pushed 6y agoCompare

[ Source](https://github.com/rudiedirkx/imap-reader)[ Packagist](https://packagist.org/packages/rdx/imap)[ RSS](/packages/rdx-imap/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

IMAP reader
===========

[](#imap-reader)

[![Build Status](https://camo.githubusercontent.com/606427b0b475172a8f1930da282544641684b64de18392fee81f74cb16de98e1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72756469656469726b782f494d41502d7265616465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rudiedirkx/IMAP-reader/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1a7eba26e4b8120ee9c7cdbede346342ac5c944c1c3f76238a18079286bcdcc6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72756469656469726b782f494d41502d7265616465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rudiedirkx/IMAP-reader/?branch=master)

Reads e-mails on an IMAP server.

Features
--------

[](#features)

- Retrieves message parts
- Recognizes PLAIN &amp; HTML parts
- Recognizes attachments

Uses PHP's built in [IMAP module](http://www.php.net/manual/en/ref.imap.php).

Examples
--------

[](#examples)

Init connection &amp; find messages:

```
$mbox = new rdx\imap\IMAPMailbox('example.com', 'user', 'password', 'INBOX', ['ssl', 'tls']);
$messages = $mbox->messages([
	'newestFirst' => true, // bool
	'seen' => false, // null|bool
	'limit' => 10, // int
	'offset' => 0, // int
]);

```

See a message's structure:

```
foreach ($messages as $message) {
	echo $message->simpleStructure() . "\n\n";

	// Could be something complex like:
	// 1. PLAIN (517)
	// 2. DELIVERY-STATUS (315)
	// 3. *RFC822 (2446)
	// 3.1. PLAIN (610)
	// 3.2. HTML (744)

	// Or something simple like:
	// 1. PLAIN (123)
	// 2. JPEG (76543)
}

```

Find all HTML parts, including attachments, forwards etc:

```
foreach ($messages as $message) {
	$htmls = $message->html(true); // true for recursive, false for only top level parts
}

```

Read bounce mail to find rejected addresses:

```
foreach ($messages as $message) {
	$body = $message->subtypeContent('DELIVERY-STATUS');
	if ($body && strpos($body, 'failed') !== false) {
		// Extract address and do something
	}
}

```

Find ALL image attachments:

```
foreach ($messages as $message) {
	$attachments = $message->subtypeParts(['JPEG', 'PNG', 'GIF'], true); // true = recursive

	foreach ($attachments as $att) {
		$att->saveAttachment('/some/folder');
	}
}

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~176 days

Recently: every ~205 days

Total

6

Last Release

2216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78549c1dc5c83ec0201c9afc66762c6d5bbf770291b12bae5a7a65350f950dba?d=identicon)[rudiedirkx](/maintainers/rudiedirkx)

---

Top Contributors

[![rudiedirkx](https://avatars.githubusercontent.com/u/168024?v=4)](https://github.com/rudiedirkx "rudiedirkx (46 commits)")

### Embed Badge

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

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

###  Alternatives

[mad-web/laravel-enum

Elegant Enum implementation for Laravel. With make:enum command, ability to casting for Eloquent models and labels translations via lang files.

110136.0k](/packages/mad-web-laravel-enum)[mad-web/nova-horizon-link

Smart Link for Laravel Nova to Horizon Dashboard.

24201.4k](/packages/mad-web-nova-horizon-link)

PHPackages © 2026

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