PHPackages                             cyber-duck/mailgrasp - 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. cyber-duck/mailgrasp

Abandoned → [cyber-duck/mailgrasp](/?search=cyber-duck%2Fmailgrasp)Library[Testing &amp; Quality](/categories/testing)

cyber-duck/mailgrasp
====================

A package for Laravel applications (5.1) to add support for email testing in your test classes.

1.1.1(9y ago)57.1k2MITPHPCI failing

Since Sep 25Pushed 4y ago4 watchersCompare

[ Source](https://github.com/Cyber-Duck/Mail-Grasp)[ Packagist](https://packagist.org/packages/cyber-duck/mailgrasp)[ Docs](https://github.com/Cyber-Duck/Mail-Grasp)[ RSS](/packages/cyber-duck-mailgrasp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

🚨 Discontinued 🚨
================

[](#-discontinued-)

This functionality is redily available in later releases of Laravel.

MailGrasp
=========

[](#mailgrasp)

[![Build Status](https://camo.githubusercontent.com/877edb7ff122708070506aad53fb94b300255dbaaca99cb22ae9eaa0ad08887b/68747470733a2f2f7472617669732d63692e6f72672f43796265722d4475636b2f4d61696c2d47726173702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Cyber-Duck/Mail-Grasp)[![Latest Stable Version](https://camo.githubusercontent.com/7846c5eb1df1260573eff68ff6543ee6cbdc7f1ef0e83213409b9a546689ed7f/68747470733a2f2f706f7365722e707567782e6f72672f63796265722d6475636b2f6d61696c67726173702f762f737461626c65)](https://packagist.org/packages/cyber-duck/mailgrasp)[![Total Downloads](https://camo.githubusercontent.com/bffbeaa6e6d8dd8fb8f67e7e3971bb2740b92fda826fa2a807f03743cac2211f/68747470733a2f2f706f7365722e707567782e6f72672f63796265722d6475636b2f6d61696c67726173702f646f776e6c6f616473)](https://packagist.org/packages/cyber-duck/mailgrasp)[![License](https://camo.githubusercontent.com/19591d3c52febc722ae90c7fc969ff73273878cec6760384135101e3ff42ebf5/68747470733a2f2f706f7365722e707567782e6f72672f63796265722d6475636b2f6d61696c67726173702f6c6963656e7365)](https://raw.githubusercontent.com/Cyber-Duck/Mail-Grasp/master/LICENSE)

MailGrasp is a package for Laravel applications (5.1+) to add support for email testing in your test classes.

Author: [Simone Todaro](https://github.com/SimoTod)

Made with ❤️ by [Cyber-Duck Ltd](http://www.cyber-duck.co.uk)

Installation
------------

[](#installation)

```
composer require cyber-duck/mailgrasp --dev

```

Usage
-----

[](#usage)

Add the `InteractsWithEmails` to your test class. That's it!

```
use \Cyberduck\MailGrasp\Testing\InteractsWithEmails;
```

The custom mailer will be initialised as soon as the visit() method is called.

### seeEmails

[](#seeemails)

It checks if exactly `$count` emails have been sent or enqueued.

```
$this->visit('/route/which/sends/2/emails')
    ->seeEmails(2);
```

### seeEmailsInQueue

[](#seeemailsinqueue)

It checks if exactly `$count` emails have been enqueued.

```
$this->visit('/route/which/enqueues/2/emails')
    ->seeEmailsInQueue(2);
```

### dontSeeEmails / notSeeEmails

[](#dontseeemails--notseeemails)

It checks that no email has been sent or enqueued.

```
$this->visit('/route/with/no/emails')
    ->dontSeeEmails();

// OR

$this->visit('/route/with/no/emails')
    ->notSeeEmails();
```

### dontSeeEmailsInQueue / notSeeEmailsInQueue

[](#dontseeemailsinqueue--notseeemailsinqueue)

It checks that no email has been enqueued.

```
$this->visit('/route/with/no/emails')
    ->dontSeeEmailsInQueue();

// OR

$this->visit('/route/with/no/emails')
    ->notSeeEmailsInQueue();
```

### seeEmail

[](#seeemail)

It checks that an email matching given critaria has been sent or enqueued.

```
$this->visit('/route/which/sends/emails')
    ->seeEmail(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    });

// OR

$this->visit('/route/which/sends/emails')
    ->seeEmail($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    });
```

### dontSeeEmail

[](#dontseeemail)

Complete opposite of seeEmail.

```
$this->visit('/route/which/sends/emails')
    ->dontSeeEmail(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    });

// OR

$this->visit('/route/which/sends/emails')
    ->dontSeeEmail($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    });
```

### seeEmailInQueue

[](#seeemailinqueue)

It checks that an email matching given critaria has been enqueued.

```
$this->visit('/route/which/enqueues/emails')
    ->seeEmailInQueue(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    });

// OR

$this->visit('/route/which/enqueues/emails')
    ->seeEmailInQueue($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    });
```

### seeInEmail

[](#seeinemail)

It checks that an email matching the given critaria contains the given string.

```
$this->visit('/route/which/sends/emails')
    ->seeInEmail(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    }, 'Lorem ipsum dolor sit amet');

// OR

$this->visit('/route/which/sends/emails')
    ->seeInEmail($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    }, 'Lorem ipsum dolor sit amet);
```

### clickInEmail

[](#clickinemail)

Visit the page in the email link. Useful to test activation links.

```
$this->visit('/route/which/enqueues/emails')
    ->clickInEmail(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    });

// OR

$this->visit('/route/which/enqueues/emails')
    ->clickInEmail($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    });
```

If there is more than one link in the email, it's possible to select the link passing a css selector as second parameter.

```
$this->visit('/route/which/enqueues/emails')
    ->clickInEmail(function($m) {
        $m->from('from@test.com');
        $m->to('to@test.com');
        $m->subject('Subject');
    }, 'a.activation-link');

// OR

$this->visit('/route/which/enqueues/emails')
    ->clickInEmail($this->message()
        ->from('from@test.com')
        ->to('to@test.com')
        ->subject('Subject');
    }, 'a.activation-link');
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 76.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 ~22 days

Recently: every ~32 days

Total

7

Last Release

3386d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/499c3ec1a8f4178f10844d45031b401be825313793d5e588636ac2d13481c1f8?d=identicon)[SimoTod](/maintainers/SimoTod)

![](https://www.gravatar.com/avatar/0c45a99726cc30692bc4821cfc198df1f5de85b1a15f9b66a0bf739acbac0309?d=identicon)[cyber-duck](/maintainers/cyber-duck)

---

Top Contributors

[![SimoTod](https://avatars.githubusercontent.com/u/8427737?v=4)](https://github.com/SimoTod "SimoTod (23 commits)")[![clemblanco](https://avatars.githubusercontent.com/u/668419?v=4)](https://github.com/clemblanco "clemblanco (5 commits)")[![karlos545](https://avatars.githubusercontent.com/u/9590468?v=4)](https://github.com/karlos545 "karlos545 (1 commits)")[![worzy](https://avatars.githubusercontent.com/u/1092417?v=4)](https://github.com/worzy "worzy (1 commits)")

---

Tags

laravellaravel-applicationstesttestingtestinglaravelemails

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cyber-duck-mailgrasp/health.svg)

```
[![Health](https://phpackages.com/badges/cyber-duck-mailgrasp/health.svg)](https://phpackages.com/packages/cyber-duck-mailgrasp)
```

###  Alternatives

[orchestra/testbench-core

Testing Helper for Laravel Development

27043.7M310](/packages/orchestra-testbench-core)[laracasts/testdummy

Easy test stubs

4671.4M36](/packages/laracasts-testdummy)[davestewart/sketchpad

An innovative front-end environment for interactive Laravel development

29512.9k1](/packages/davestewart-sketchpad)[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2227.8k](/packages/guanguans-laravel-soar)[hyvor/laravel-playwright

Laravel and Playwright E2E Testing

3312.0k](/packages/hyvor-laravel-playwright)[srlabs/laravel-testing-utilities

Helper utilities for testing Laravel Applications

1011.9k](/packages/srlabs-laravel-testing-utilities)

PHPackages © 2026

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