PHPackages                             mdhesari/laravel-driver - 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. mdhesari/laravel-driver

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

mdhesari/laravel-driver
=======================

MailerSend Laravel Driver

v2.2.1(3y ago)05MITPHPPHP ^8.0

Since Aug 12Pushed 3y agoCompare

[ Source](https://github.com/Mdhesari/mailersend-laravel-driver)[ Packagist](https://packagist.org/packages/mdhesari/laravel-driver)[ Docs](https://github.com/mailersend/mailersend-laravel-driver)[ RSS](/packages/mdhesari-laravel-driver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (14)Used By (0)

[![](https://camo.githubusercontent.com/0feba5e88bb82404f190f6c877d7ecaf9c17f0b0ffe4f7fb82928bae60104ed7/68747470733a2f2f7777772e6d61696c657273656e642e636f6d2f696d616765732f6c6f676f2e737667)](https://www.mailersend.com)

MailerSend Laravel Driver

[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE.md)

Table of Contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [Support and Feedback](#support-and-feedback)
- [License](#license)

Installation
============

[](#installation)

Requirements
------------

[](#requirements)

- Laravel 9.0+
- PHP 8.0+
- Guzzle 7.0+
- An API Key from [mailersend.com](https://www.mailersend.com)

**For Laravel 7.x - 8.x support see [1.x branch](https://github.com/mailersend/mailersend-laravel-driver/tree/1.x)**

Setup
-----

[](#setup)

You can install the package via composer:

```
composer require mailersend/laravel-driver
```

After that, you need to set `MAILERSEND_API_KEY` in your `.env` file:

```
MAILERSEND_API_KEY=
```

Add MailerSend as a Laravel Mailer in `config/mail.php` in `mailers` array:

```
'mailersend' => [
    'transport' => 'mailersend',
],
```

And set environment variable `MAIL_MAILER` in your `.env` file

```
MAIL_MAILER=mailersend
```

Also, double check that your `FROM` data is filled in `.env`:

```
MAIL_FROM_ADDRESS=app@yourdomain.com
MAIL_FROM_NAME="App Name"
```

Usage
=====

[](#usage)

This is an example [mailable](https://laravel.com/docs/9.x/mail#writing-mailables) that you can use to send an email with.

`app/Mail/TestEmail.php`

```
namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Arr;
use MailerSend\Helpers\Builder\Variable;
use MailerSend\Helpers\Builder\Personalization;
use MailerSend\LaravelDriver\MailerSendTrait;

class TestEmail extends Mailable
{
    use Queueable, SerializesModels, MailerSendTrait;

    public function build()
    {
        // Recipient for use with variables and/or personalization
        $to = Arr::get($this->to, '0.address');

        return $this
            ->view('emails.test_html')
            ->text('emails.test_text')
            ->attachFromStorageDisk('public', 'example.png')
            // Additional options for MailerSend API features
            ->mailersend(
                template_id: null,
                variables: [
                    new Variable($to, ['name' => 'Your Name'])
                ],
                tags: ['tag'],
                personalization: [
                    new Personalization($to, [
                        'var' => 'variable',
                        'number' => 123,
                        'object' => [
                            'key' => 'object-value'
                        ],
                        'objectCollection' => [
                            [
                                'name' => 'John'
                            ],
                            [
                                'name' => 'Patrick'
                            ]
                        ],
                    ])
                ],
                precedenceBulkHeader: true,
                sendAt: new Carbon('2022-01-28 11:53:20'),
            );
    }
}
```

We provide a `MailerSendTrait` trait that adds a `mailersend` method to the mailable and allows you to use additional options that are available through our API.

After creating the mailable, you can send it using:

```
use App\Mail\TestEmail;
use Illuminate\Support\Facades\Mail;

Mail::to('recipient@domain.com')
    ->cc('cc@domain.com')
    ->bcc('bcc@domain.com')
    ->send(new TestEmail());
```

Please refer to [Laravel Mail documenation](https://laravel.com/docs/9.x/mail) and [MailerSend API documentation](https://developers.mailersend.com) for more information.

Support and Feedback
====================

[](#support-and-feedback)

In case you find any bugs, submit an issue directly here in GitHub.

If you have any troubles using our driver, feel free to contact our support by email

Official API documentation is at

License
=======

[](#license)

[The MIT License (MIT)](LICENSE.md)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~71 days

Recently: every ~78 days

Total

13

Last Release

1236d ago

Major Versions

v0.1.1 → v1.02021-01-29

1.x-dev → v2.0.02022-02-11

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

v1.0PHP ^7.4|^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7504d2dd62302fe03079daa3b37a7cb007d7d67d9aacdf8f5128282d4ab15fcc?d=identicon)[mdhesari](/maintainers/mdhesari)

---

Top Contributors

[![fosron](https://avatars.githubusercontent.com/u/3708631?v=4)](https://github.com/fosron "fosron (6 commits)")[![JoaoFSCruz](https://avatars.githubusercontent.com/u/26048679?v=4)](https://github.com/JoaoFSCruz "JoaoFSCruz (3 commits)")[![Mdhesari](https://avatars.githubusercontent.com/u/28428724?v=4)](https://github.com/Mdhesari "Mdhesari (2 commits)")[![nklmilojevic](https://avatars.githubusercontent.com/u/9573356?v=4)](https://github.com/nklmilojevic "nklmilojevic (2 commits)")[![jestherthejoker](https://avatars.githubusercontent.com/u/6953492?v=4)](https://github.com/jestherthejoker "jestherthejoker (1 commits)")[![doobas](https://avatars.githubusercontent.com/u/14978210?v=4)](https://github.com/doobas "doobas (1 commits)")[![gausejakub](https://avatars.githubusercontent.com/u/19504292?v=4)](https://github.com/gausejakub "gausejakub (1 commits)")[![dinomh](https://avatars.githubusercontent.com/u/25065792?v=4)](https://github.com/dinomh "dinomh (1 commits)")

---

Tags

emailtransactionalmailersendlaravel-driver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mdhesari-laravel-driver/health.svg)

```
[![Health](https://phpackages.com/badges/mdhesari-laravel-driver/health.svg)](https://phpackages.com/packages/mdhesari-laravel-driver)
```

###  Alternatives

[mailersend/laravel-driver

MailerSend Laravel Driver

87732.8k4](/packages/mailersend-laravel-driver)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[mailersend/mailersend

MailerSend PHP SDK

801.0M7](/packages/mailersend-mailersend)[slot/mandrill-bundle

Symfony Mandrill Bundle

671.5M1](/packages/slot-mandrill-bundle)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[bentonow/bento-laravel-sdk

Laravel SDK for Bento

2338.5k1](/packages/bentonow-bento-laravel-sdk)

PHPackages © 2026

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