PHPackages                             resohead/laravel-test-mail - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. resohead/laravel-test-mail

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

resohead/laravel-test-mail
==========================

Quickly send test emails using commands in Laravel applications

v2.0.0(4y ago)22.6k↓60.4%[1 PRs](https://github.com/resohead/laravel-test-mail/pulls)MITPHPPHP ^8.0CI failing

Since Mar 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/resohead/laravel-test-mail)[ Packagist](https://packagist.org/packages/resohead/laravel-test-mail)[ Docs](https://github.com/resohead/laravel-test-mail)[ RSS](/packages/resohead-laravel-test-mail/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Laravel Test Mail
=================

[](#laravel-test-mail)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a3f97ae4a41174b912a9d79db80679abe60eab692f10f3a560ecd666dfad861c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7265736f686561642f6c61726176656c2d746573742d6d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/resohead/laravel-test-mail)[![Build Status](https://camo.githubusercontent.com/d4c53bf73e6b3229399e6ee2a39e959f3799c0b623d145b87928d8f31afef7c2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265736f686561642f6c61726176656c2d746573742d6d61696c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/resohead/laravel-test-mail/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/693ffee6e56e72a1f07cbfc7e3e705c1893c8059abc3b864846fbd8c6f356335/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7265736f686561642f6c61726176656c2d746573742d6d61696c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/resohead/laravel-test-mail/?branch=master)[![Quality Score](https://camo.githubusercontent.com/6d70e39aa86dd674e45d2b4cd468085a9d20ab34459d21ff2e1730a27e19c89e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7265736f686561642f6c61726176656c2d746573742d6d61696c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/resohead/laravel-test-mail)[![Maintainability](https://camo.githubusercontent.com/695faeca5252f10dd8342d36a7be45717012a3524c9eecd4a7fd9dafb6345a3e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64646632623931633464366335393564366666302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/resohead/laravel-test-mail/maintainability)[![Total Downloads](https://camo.githubusercontent.com/afacd9b1708d2983e2023afb0ce8009a914f72d6daf27e9d960001d61580ce27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7265736f686561642f6c61726176656c2d746573742d6d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/resohead/laravel-test-mail)

A simple package to send test emails from artisan commands in Laravel applications. Ideal for checking mail and queue configurations without any setup.

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

[](#installation)

You can install the package via composer:

```
composer require resohead/laravel-test-mail
```

The package will automatically register itself.

Optionally publish the config file to enable presets:

```
php artisan vendor:publish --provider="Resohead\LaravelTestMail\LaravelTestMailServiceProvider" --tag="config"

```

Basic Usage
-----------

[](#basic-usage)

To send a test email run the following artisan command:

```
php artisan mail:test
```

By default this will:

- send to the 'from' address defined in your mail config,
- use your default mail driver,
- synchronous processing

Alternatively you have four other options in the command signature:

- set the email address,
- change the mail driver,
- enable for queuing (and set the queue name)
- change the queue connection
- select a preset

> Changing the mail driver and running through a queue might require the queue worker to be started/reset.

Command Line Options
--------------------

[](#command-line-options)

### Send to specified email

[](#send-to-specified-email)

```
php artisan mail:test name@example.com

```

### Send to specified email on default queue

[](#send-to-specified-email-on-default-queue)

```
php artisan mail:test name@example.com --queue

```

### Send via log driver

[](#send-via-log-driver)

```
php artisan mail:test --driver=log

```

### Send to the 'emails' queue on default connection

[](#send-to-the-emails-queue-on-default-connection)

```
php artisan mail:test --stack=emails

```

> There is no need to set the --queue flag when using the stack argument

### Send using 'sqs' queue connection

[](#send-using-sqs-queue-connection)

```
php artisan mail:test --connection=sqs

```

> There is no need to set the --queue flag when using the connection argument

### Send using the SMTP driver via the 'emails' queue on the 'redis' connection

[](#send-using-the-smtp-driver-via-the-emails-queue-on-the-redis-connection)

```
php artisan mail:test name@example.com --driver=smtp --connection=redis --stack=emails

```

Queues
------

[](#queues)

> You might need to start the your queue if using the connection option, for example

```
php artisan queue:work sqs --queue:emails

```

Presets
-------

[](#presets)

You can also configure presets to group command line options. The values defined in each preset will be merged with the command line values and your default mail and queue configuration.

### Example config\\mail-test.php

[](#example-configmail-testphp)

```
'presets' => [

        'example1' => [
            'recipient' => 'preset1@example.com',
            'queue' => true
        ],

        'example2' => [
            'driver' => 'log',
            'stack' => 'emails'
        ],

        'example3' => [
            'recipient' => env('EMAIL_TO', 'preset3@example.com'),
            'driver' => 'smtp',
            'connection' => 'redis',
            'stack' => 'notifications'
        ],

    ]

```

### Preset: Example 1

[](#preset-example-1)

Set a specific email address and use default queue:

```
php artisan mail:test --preset=example1

// php artisan mail:test preset1@example.com --queue

```

### Preset: Example 2

[](#preset-example-2)

Use the log mail driver and emails queue

```
php artisan mail:test --preset=example2

// php artisan mail:test --driver=log --stack=emails

```

### Preset: Example 3

[](#preset-example-3)

Use the log mail driver and emails queue

```
php artisan mail:test --preset=example3

// php artisan mail:test preset3@example.com --driver=smtp --connection=redis --stack=notifications

```

Alternatives
------------

[](#alternatives)

This is a simple package designed to quickly trigger an email to check your configuration.

If you want to check what an email looks like in the browser use the Laravel documentation to [render mailables](https://laravel.com/docs/mail#rendering-mailables) (available since Laravel 5.5).

If you need a package to send a mailable using fake data try using [Spatie's laravel-mailable-test package](https://github.com/spatie/laravel-mailable-test).

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Sean White](https://github.com/resohead)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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 ~183 days

Total

5

Last Release

1561d ago

Major Versions

v0.2.0 → v1.0.02020-03-29

v1.0.1 → v2.0.02022-03-26

PHP version history (3 changes)v0.1.0PHP ^7.1

v1.0.1PHP ^7.3 || ^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![resohead](https://avatars.githubusercontent.com/u/13508056?v=4)](https://github.com/resohead "resohead (23 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

resoheadlaravel-test-mail

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/resohead-laravel-test-mail/health.svg)

```
[![Health](https://phpackages.com/badges/resohead-laravel-test-mail/health.svg)](https://phpackages.com/packages/resohead-laravel-test-mail)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[illuminate/mail

The Illuminate Mail package.

5910.6M502](/packages/illuminate-mail)[illuminate/notifications

The Illuminate Notifications package.

513.1M1.1k](/packages/illuminate-notifications)

PHPackages © 2026

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