PHPackages                             silverslice/mail-reader - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. silverslice/mail-reader

ActiveLibrary[Testing &amp; Quality](/categories/testing)

silverslice/mail-reader
=======================

Test emails easily

v1.0(4y ago)161↓100%MITPHPPHP &gt;=7.2

Since Jun 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/silverslice/mail-reader)[ Packagist](https://packagist.org/packages/silverslice/mail-reader)[ RSS](/packages/silverslice-mail-reader/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (3)Used By (0)

Test emails easily in php
=========================

[](#test-emails-easily-in-php)

[![Coverage Status](https://camo.githubusercontent.com/de0d9a7e9067b6ddd8f93067a7d590845a522904ca688abe89d3e7cdf8ff730c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73696c766572736c6963652f6d61696c2d7265616465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/silverslice/mail-reader?branch=master)

Without mailcatcher headache:)

**MailReader** stores your emails in local directory and provides convenient way to test them.

Install
-------

[](#install)

`composer require silverslice/mail-reader`

Usage
-----

[](#usage)

- Copy `bin/smtp_catcher.php` to convenient folder.
- Specify folder for e-mails in `bin/smtp_catcher.php` (optional).
- Set in php.ini: `sendmail_path = /path/to/smtp_catcher.php`
- Write test:

```
use Silverslice\MailReader\MailReader;

...

public function testGetLastMessage()
{
    $reader = new MailReader('/path/to/mails/');

    // get last sent message
    $message = $reader->getLastMessage();

    $this->assertEquals('fromemail@mail.dev', $message->getFrom());
    $this->assertEquals('toemail@mail.dev', $message->getTo());
    $this->assertEquals('Third email', $message->getSubject());
    $this->assertContains('This is the last email', $message->getBody());

    $this->assertTrue($message->hasAttachment());
    $this->assertTrue($message->hasAttachmentWithName('file1.txt'));

    // get total count of messages
    $count = $reader->getCountOfMessages();

    // get next to the last message
    $prevMessage = $reader->getLastMessageByIndex(1);

    // clear all messages
    $reader->clearMessages();
}
```

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~2080 days

Total

2

Last Release

1501d ago

Major Versions

v0.1.0 → v1.02022-02-11

PHP version history (2 changes)v0.1.0PHP &gt;=5.4

v1.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![silverslice](https://avatars.githubusercontent.com/u/6722542?v=4)](https://github.com/silverslice "silverslice (12 commits)")

---

Tags

testmailemail

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/silverslice-mail-reader/health.svg)

```
[![Health](https://phpackages.com/badges/silverslice-mail-reader/health.svg)](https://phpackages.com/packages/silverslice-mail-reader)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k488.3M21.1k](/packages/mockery-mockery)[hamcrest/hamcrest-php

This is the PHP port of Hamcrest Matchers

7.1k475.4M96](/packages/hamcrest-hamcrest-php)[nelmio/alice

Expressive fixtures generator

2.5k42.8M126](/packages/nelmio-alice)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78011.3M80](/packages/zenstruck-foundry)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

37417.5M84](/packages/php-mock-php-mock)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33112.0M293](/packages/brain-monkey)

PHPackages © 2026

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