PHPackages                             drese/laravel-maileroo - 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. drese/laravel-maileroo

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

drese/laravel-maileroo
======================

Laravel wrapper and integration for Maileroo SDK - seamless mail transport and form submissions

v1.0.1(7mo ago)012MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Oct 7Pushed 7mo agoCompare

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

READMEChangelogDependencies (6)Versions (3)Used By (0)

Laravel Maileroo
================

[](#laravel-maileroo)

A Laravel wrapper package for [Maileroo](https://maileroo.com/?r=drese) (\*affiliate link) that provides seamless integration with Laravel's Mail system and form submissions. This package wraps the Maileroo SDK to make email sending simple and Laravel-friendly.

Features
--------

[](#features)

- ✅ Seamless Laravel Mail integration
- ✅ Works with Mailables, Notifications, and Queued emails
- ✅ Form submission helper with auto-formatted HTML tables
- ✅ Direct SDK access when needed
- ✅ Support for CC, BCC, and Reply-To
- ✅ Attachment support
- ✅ Auto-discovery for Laravel

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x

Create a Maileroo Account
-------------------------

[](#create-a-maileroo-account)

If you do not already have one, create a [Maileroo Account here](https://maileroo.com/?r=drese) (\*affiliate link). Once created, you will need to generate an API key and have it handy when setting up your environment variables.

Maileroo offers a generous free tier to get you going.

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

[](#installation)

Install the package via Composer:

```
composer require drese/laravel-maileroo
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=maileroo-config
```

### Configure Environment

[](#configure-environment)

Add the following to your `.env` file:

```
MAILEROO_API_KEY=your-api-key-here
MAIL_MAILER=maileroo
MAILEROO_TIMEOUT=30
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME="John Smith"
```

### Update Mail Configuration

[](#update-mail-configuration)

Add Maileroo to the `mailers` array in `config/mail.php`:

```
'mailers' => [
    'maileroo' => [
        'transport' => 'maileroo',
    ],
    // ... other mailers
],
```

Usage
-----

[](#usage)

### Transactional Emails

[](#transactional-emails)

Use Laravel's standard Mail facade with any Mailable:

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

Mail::to('user@example.com')->send(new WelcomeEmail($user));
```

Or send via Notifications:

```
$user->notify(new InvoicePaid($invoice));
```

### Standard Mailable Example

[](#standard-mailable-example)

Mailables work automatically with the Maileroo transport:

```
namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Queue\SerializesModels;

class WelcomeEmail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public $user
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            from: new Address('welcome@example.com', 'Welcome Team'),
            subject: 'Welcome to Our Platform!',
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.welcome',
        );
    }

    public function attachments(): array
    {
        return [];
    }
}
```

**Simple Email via Maileroo Facade:**

```
use Drese\LaravelMaileroo\Facades\Maileroo;

Maileroo::sendEmail([
    'from' => 'sender@example.com',
    'to' => 'recipient@example.com',
    'subject' => 'Hello',
    'html' => 'Hello World!',
    'plain' => 'Hello World!',
]);
```

### Form Submissions

[](#form-submissions)

The package includes a convenient form submission helper that automatically formats form data into an HTML table.

**Using the Facade:**

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Drese\LaravelMaileroo\Facades\Maileroo;

class ContactController extends Controller
{
    public function submit(Request $request)
    {
        $validated = $request->validate([
            'name' => 'required|string',
            'email' => 'required|email',
            'subject' => 'required|string',
            'message' => 'required|string',
        ]);

        $referenceId = Maileroo::sendFormNotification(
            $validated,
            'admin@example.com',
            'New Contact: ' . $validated['subject']
        );

        return back()->with('success', "Message sent! Reference: {$referenceId}");
    }
}
```

**Using Dependency Injection:**

```
use Drese\LaravelMaileroo\MailerooFormService;

class ContactController extends Controller
{
    public function submit(Request $request, MailerooFormService $maileroo)
    {
        $validated = $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'message' => 'required',
        ]);

        $referenceId = $maileroo->sendFormNotification(
            $validated,
            'admin@example.com',
            'New Contact Form Submission'
        );

        return back()->with('success', "Message sent! Reference: {$referenceId}");
    }
}
```

### Direct SDK Access

[](#direct-sdk-access)

For advanced use cases, you can access the Maileroo SDK directly.

**Advanced Example with Attachments:**

```
namespace App\Services;

use Maileroo\MailerooClient;
use Maileroo\EmailAddress;
use Maileroo\Attachment;

class EmailService
{
    public function __construct(
        protected MailerooClient $client
    ) {}

    public function sendInvoice($invoice)
    {
        return $this->client->sendBasicEmail([
            'from' => new EmailAddress('billing@example.com', 'Billing Team'),
            'to' => new EmailAddress($invoice->customer->email, $invoice->customer->name),
            'subject' => 'Invoice #' . $invoice->number,
            'html' => view('emails.invoice', compact('invoice'))->render(),
            'attachments' => [
                Attachment::fromFile($invoice->pdf_path, 'application/pdf')
            ],
            'tags' => [
                'type' => 'invoice',
                'customer_id' => $invoice->customer_id,
            ],
            'reference_id' => 'invoice-' . $invoice->id,
        ]);
    }
}
```

**Scheduled Emails:**

```
public function scheduleEmail()
{
    return $this->client->sendBasicEmail([
        'from' => new EmailAddress('sender@example.com'),
        'to' => new EmailAddress('recipient@example.com'),
        'subject' => 'Scheduled Email',
        'html' => 'This will be sent later',
        'scheduled_at' => date('c', strtotime('+1 day')),
    ]);
}
```

**Bulk Emails:**

```
public function sendBulk()
{
    return $this->client->sendBulkEmails([
        'subject' => 'Newsletter',
        'html' => 'Hello {{name}}!',
        'messages' => [
            [
                'from' => new EmailAddress('newsletter@example.com'),
                'to' => new EmailAddress('user1@example.com'),
                'template_data' => ['name' => 'John'],
            ],
            [
                'from' => new EmailAddress('newsletter@example.com'),
                'to' => new EmailAddress('user2@example.com'),
                'template_data' => ['name' => 'Jane'],
            ],
        ],
    ]);
}
```

License
-------

[](#license)

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

Support
-------

[](#support)

This package is provided as-is in the hope that it will benefit the Laravel community. It is offered without warranty and without commitment to ongoing support.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance64

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

217d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4910b5f15c9ac8420168c7766d1985bb9065d509e24f9352c01bed9390bc837a?d=identicon)[drese](/maintainers/drese)

---

Top Contributors

[![drese](https://avatars.githubusercontent.com/u/6521008?v=4)](https://github.com/drese "drese (3 commits)")

---

Tags

laravelmailemailsmtpmaileroo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drese-laravel-maileroo/health.svg)

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

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

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

Laravel package for sending mail via the Postmark API

2152.9M1](/packages/coconutcraig-laravel-postmark)[rulr/laravel-mailpot

A local mail inbox for Laravel

161.9k](/packages/rulr-laravel-mailpot)

PHPackages © 2026

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