PHPackages                             dcblogdev/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. dcblogdev/imap

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

dcblogdev/imap
==============

IMAP class for reading imap emails with PHP

v1.0.3(3y ago)7183MITPHPPHP &gt;=7.2

Since Jun 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dcblogdev/imap)[ Packagist](https://packagist.org/packages/dcblogdev/imap)[ GitHub Sponsors](https://github.com/dcblogdev)[ RSS](/packages/dcblogdev-imap/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4948fea388dacfc328c7ea75313dd161db2dab9c9ba1c493ea3fdbd03b161376/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6463626c6f676465762f696d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/imap)[![Total Downloads](https://camo.githubusercontent.com/153270c59a4866f90121208ed066c4ce207d70249e888def3673f2d6b58490bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6463626c6f676465762f696d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/imap)

[![Logo](https://repository-images.githubusercontent.com/74881390/3b747080-49bf-11eb-9d44-c941e96ba0e7)](https://repository-images.githubusercontent.com/74881390/3b747080-49bf-11eb-9d44-c941e96ba0e7)

IMAP class for reading IMAP emails with PHP

Example usage:
==============

[](#example-usage)

```
use Dcblogdev\Imap\Imap;

//set search criteria
$date = date('d-M-y', strtotime('1 week ago'));
$term = 'ALL UNDELETED SINCE "'.$date.'"';

//ignore array of emails
$exclude = [];

$email    = 'someone@domain.com';
$password = 'emailpassword';
$host     = 'outlook.office365.com';//your email host
$port     = '993';//port number
$savePath = "emails";//folder to save attachments
$markAsSeen = true;//when true mark email as been read
$delete   = false;//set to true to delete email

//initialise email
$imap = new Imap($email, $password, $host, $port, 'Inbox', $savePath, $markAsSeen, $delete);

//get emails pass in the search term and exclude array
$emails = $imap->emails($term, $exclude);

//loop over emails and display
foreach($emails as $email) {

	echo "Account {$email['account']}";
	echo "Subject {$email['subject']}";
	echo "From {$email['fromName']} ({$email['fromAddress']})";
	echo "To {$email['toAddress']}";
	echo "CC {$email['ccAddress']}";
	echo "Date {$email['emailDate']}";
	echo count($email['attachments'])." Attachments";

	foreach($email['attachments'] as $attachment) {
		echo "{$attachment['fileName']}";
	}

	echo "";
	if ($email['htmlBody'] !='') {
		echo $email['htmlBody'];
	} else {
		echo nl2br($email['plainBody']);
	}
	echo "";
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~255 days

Total

4

Last Release

1397d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39399156?v=4)[dcblog](/maintainers/dcblog)[@dcblog](https://github.com/dcblog)

---

Top Contributors

[![dcblogdev](https://avatars.githubusercontent.com/u/1018170?v=4)](https://github.com/dcblogdev "dcblogdev (10 commits)")[![daveismynamecom](https://avatars.githubusercontent.com/u/60222583?v=4)](https://github.com/daveismynamecom "daveismynamecom (5 commits)")

---

Tags

hacktoberfestimapphp

### Embed Badge

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

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

PHPackages © 2026

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