Send emails using Laravel's MailerSend driver

Use the MailerSend mailer driver in Laravel to send emails

Last Updated


Integration Support

See the documentation.

Additional details

Find the Laravel documentation to use the MailerSend driver.


You can install the package via composer:

composer require mailersend/laravel-driver

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


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

'mailersend' => [
    'transport' => 'mailersend',

And put the environment variable MAIL_MAILER in your .env file


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


This is an example mailable that you can use to send an email.

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
            ->attachFromStorageDisk('public', 'example.png')
            // Additional options for MailerSend API features
                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 available through our API.

After creating the mailable, you can send it using:

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

    ->send(new TestEmail());

Please refer to Laravel Mail documenation and MailerSend API documentation for more information.

Support and Feedback

If you find any bugs, submit an issue directly on GitHub.

Stop War! Help Ukraine! See what you can do