PHPackages                             drakakisgeo/mailtester - 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. drakakisgeo/mailtester

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

drakakisgeo/mailtester
======================

Mail testing helper

v2.1.1(4y ago)42.7k2MITPHPPHP ~7.2|~7.3|~7.4|~8.0|~8.1CI failing

Since Feb 23Pushed 4y agoCompare

[ Source](https://github.com/drakakisgeo/mailtester)[ Packagist](https://packagist.org/packages/drakakisgeo/mailtester)[ Docs](https://github.com/drakakisgeo/mailtester)[ RSS](/packages/drakakisgeo-mailtester/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (7)Versions (25)Used By (0)

Mail Tester
===========

[](#mail-tester)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a08161e67c03cb630e8b640ac668c5056162b6fe7d2414607626f6d1e35ebe4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472616b616b697367656f2f6d61696c7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drakakisgeo/mailtester)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0f909194e3923328d5411f92d3fee503f7a30a83bd5e46450f5ca0b5836cf87b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6472616b616b697367656f2f6d61696c7465737465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/drakakisgeo/mailtester)[![Quality Score](https://camo.githubusercontent.com/de3aa0a2e032981536d83b09a1fbdafca9a546023c32f2a7a6aeb306a42b2d13/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6472616b616b697367656f2f6d61696c7465737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/drakakisgeo/mailtester)[![Total Downloads](https://camo.githubusercontent.com/33a1c50362c74c9fbaea6eb0499beb70a1151c06fccfec19182af8b46c403156/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6472616b616b697367656f2f6d61696c7465737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drakakisgeo/mailtester)

A package to help with acceptance Email testing. The goal is to add usefull PHPunit assertions in a Trait that you can include when there is a need to test emails that are fired from acceptance testing packages like Laravel Dusk.

Install
-------

[](#install)

This package assumes that you've already installed Mailcatcher. You can check this [tutorial](https://serversforhackers.com/setting-up-mailcatcher) on how to install it to your system.

### Via Composer

[](#via-composer)

```
$ composer require drakakisgeo/mailtester
```

### Laravel 5.\*

[](#laravel-5)

After updating composer, add the ServiceProvider to the providers array in config/app.php

```
Drakakisgeo\Mailtester\MailtesterServiceProvider::class,
```

Copy the package config to your local config with the publish command:

```
$ php artisan vendor:publish --provider="Drakakisgeo\Mailtester\MailtesterServiceProvider"
```

Instructions
------------

[](#instructions)

Include the **InteractsWithMailCatcher** Trait in your test and make sure that your test extends the Laravel's Testcase class. Immediately you have access to the following methods:

#### Email was send

[](#email-was-send)

- assertEmailIsSent()

#### Email subject contains a $string

[](#email-subject-contains-a-string)

- assertEmailFirstSubjectContains()
- assertEmailLastSubjectContains()
- assertEmailNthSubjectContains()

#### Email subject equals a $string

[](#email-subject-equals-a-string)

- assertEmailFirstSubjectEquals()
- assertEmailLastSubjectEquals()
- assertEmailNthSubjectEquals()
- assertEmailSubjectEquals()

#### Email Html body contains a $string

[](#email-html-body-contains-a-string)

- assertEmailFirstHtmlContains()
- assertEmailLastHtmlContains()
- assertEmailNthHtmlContains()
- assertEmailHtmlContains()

#### Email Text body contains a $string

[](#email-text-body-contains-a-string)

- assertEmailFirstTextContains()
- assertEmailLastTextContains()
- assertEmailNthTextContains()
- assertEmailTextContains()

#### Email sender is the target $email

[](#email-sender-is-the-target-email)

- assertEmailFirstSenderEquals()
- assertEmailLastSenderEquals()
- assertEmailNthSenderEquals()
- assertEmailSenderEquals()

#### Email recipient is the target $email

[](#email-recipient-is-the-target-email)

- assertEmailFirstRecipientsContain()
- assertEmailLastRecipientsContain()
- assertEmailNthRecipientsContain()
- assertEmailRecipientsContain()

#### Email Cc is the target $email

[](#email-cc-is-the-target-email)

- assertEmailFirstCcContain()
- assertEmailLastCcContain()
- assertEmailNthCcContain()
- assertEmailCcContain()

#### Email Bcc is the target $email

[](#email-bcc-is-the-target-email)

- assertEmailFirstBccContain()
- assertEmailLastBccContain()
- assertEmailNthtBccContain()
- assertEmailBccContain()

#### Email Attachment is the target $file

[](#email-attachment-is-the-target-file)

- Soon!

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Drakakis George](https://github.com/drakakisgeo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.2% 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 ~86 days

Recently: every ~216 days

Total

23

Last Release

1472d ago

Major Versions

v1.0.14 → v2.02018-04-06

PHP version history (5 changes)v1.0.0PHP ~5.6|~7.0

v2.0PHP ~7.0

v2.0.2PHP ~7.2

v2.1.0PHP ~7.2|~7.3|~7.4

v2.1.1PHP ~7.2|~7.3|~7.4|~8.0|~8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2325657fff67da73e882b57a74e8ef6eba63d93cc5e5501bfa3a15e8929688f2?d=identicon)[lollypopgr](/maintainers/lollypopgr)

---

Top Contributors

[![drakakisgeo](https://avatars.githubusercontent.com/u/1863506?v=4)](https://github.com/drakakisgeo "drakakisgeo (56 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

emaillaravelmailcatcherphpunit-assertionstestingdrakakisgeomailtester

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drakakisgeo-mailtester/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)

PHPackages © 2026

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