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

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

mailkite/laravel
================

MailKite for Laravel — a native mail transport so MAIL\_MAILER=mailkite just works. Send over your verified domain, receive inbound email as a webhook.

v0.1.0(1mo ago)00MITPHPPHP ^8.2

Since Jul 4Pushed 1mo agoCompare

[ Source](https://github.com/mailkite/laravel)[ Packagist](https://packagist.org/packages/mailkite/laravel)[ Docs](https://mailkite.dev/docs/libraries)[ RSS](/packages/mailkite-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

 [   ![MailKite](https://camo.githubusercontent.com/eac2f261fe0f4a45ba5857b4190dc9f3060d304a2a0aeeed880407f85faf95cd/68747470733a2f2f6d61696c6b6974652e6465762f6272616e642f6c6f676f2d656d61696c2e706e67)  ](https://mailkite.dev)

MailKite for Laravel
====================

[](#mailkite-for-laravel)

 **Email for every product you ship** — send over a verified domain, receive email as a webhook, give an AI agent its own inbox.
The official [MailKite](https://mailkite.dev) mail transport for Laravel: `MAIL_MAILER=mailkite` just works.

 [Docs](https://mailkite.dev/docs) · [Library guide](https://mailkite.dev/docs/libraries) · [mailkite.dev](https://mailkite.dev) · [AI agents](https://mailkite.dev/docs/ai-agents)

[![Packagist](https://camo.githubusercontent.com/cab0c00fb1be742f9c0fa7874e9977855fb7e891fcbfec7982e55a9fcc3efb85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61696c6b6974652f6c61726176656c3f636f6c6f723d323536336562266c6162656c3d5061636b6167697374)](https://packagist.org/packages/mailkite/laravel)

> **Read-only mirror.** This repo is a generated, release-time mirror of the MailKite monorepo (the private source of truth) — development doesn't happen here. Install from Packagist and open issues against the [MailKite docs](https://mailkite.dev/docs).

Install
-------

[](#install)

```
composer require mailkite/laravel
```

Requires PHP 8.2+ and Laravel 11 or 12. The service provider is auto-discovered — no manual registration.

Configure
---------

[](#configure)

Add your API key to `.env` (create one in the [dashboard](https://app.mailkite.dev)):

```
MAIL_MAILER=mailkite
MAILKITE_API_KEY=mk_live_…
MAIL_FROM_ADDRESS=hello@yourdomain.com
MAIL_FROM_NAME="Your App"
```

Register the mailer in `config/mail.php`:

```
'mailers' => [
    // …
    'mailkite' => [
        'transport' => 'mailkite',
    ],
],
```

And the credentials in `config/services.php` (the standard Laravel home for provider keys):

```
'mailkite' => [
    'key' => env('MAILKITE_API_KEY'),
],
```

That's it — every `Mail::send()` in your app now delivers through MailKite. The `from` domain must be [verified](https://mailkite.dev/docs) (SPF + DKIM) on your MailKite account.

Send
----

[](#send)

Any Laravel Mailable works unchanged:

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

Mail::to('ada@example.com')->send(new InvoicePaid($invoice));
```

```
namespace App\Mail;

use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;

class InvoicePaid extends Mailable
{
    public function __construct(public \App\Models\Invoice $invoice) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: "Your invoice #{$this->invoice->number}",
            replyTo: ['support@yourdomain.com'],
        );
    }

    public function content(): Content
    {
        return new Content(markdown: 'mail.invoice-paid');
    }

    public function attachments(): array
    {
        return [
            Attachment::fromData(fn () => $this->invoice->pdf(), 'invoice.pdf')
                ->withMime('application/pdf'),
        ];
    }
}
```

What maps where
---------------

[](#what-maps-where)

Laravel / Symfony EmailMailKite `send`from, to, cc, bcc`from`, `to`, `cc`, `bcc` (display names preserved)subject`subject`HTML + text bodies`html`, `text`reply-to (single)`replyTo``In-Reply-To` header`inReplyTo` (threading)attachments`attachments` — base64 `content` + `filename` + `contentType`**Honest failures, not silent drops.** The MailKite send API carries a fixed envelope, so the transport throws a `TransportException` (with the API's own error message) instead of pretending:

- API errors (unverified domain, suppressed recipient, rate limit, …) surface verbatim with their HTTP status.
- Custom headers (e.g. `X-Campaign`, Laravel's `->tag()` / `->metadata()`) are refused — the API can't deliver them.
- Inline (`cid:`-embedded) images are refused — host the image at a URL instead.
- Multiple reply-to addresses are refused — the API takes one.

Receive inbound email (webhook)
-------------------------------

[](#receive-inbound-email-webhook)

MailKite delivers inbound mail to your app as a signed webhook. Verify the signature with the bundled PHP SDK — this package binds `\MailKite\Client` into the container:

```
// routes/api.php
Route::post('/inbound-email', InboundEmailController::class);
```

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use MailKite\Client;

class InboundEmailController
{
    public function __invoke(Request $request, Client $mailkite)
    {
        $verified = $mailkite->verifyWebhook(
            $request->header('x-mailkite-signature', ''),
            $request->getContent(),          // raw, unparsed body
            config('services.mailkite.webhook_secret'),
        );
        abort_unless($verified, 401);

        $email = $request->json()->all();
        // $email['from'], $email['subject'], $email['text'], …

        return response($mailkite->replyOk(), 200)->header('Content-Type', 'application/json');
    }
}
```

Add the webhook secret (shown when you set the domain's webhook) to `config/services.php` as `services.mailkite.webhook_secret`, and remember to exempt the route from CSRF if you register it in `web.php`. Full inbound guide: .

All MailKite libraries
----------------------

[](#all-mailkite-libraries)

Same contract, every language (full list: ):

LibraryRepoDistributionMailKite for Laravel **(this repo)**[`laravel`](https://github.com/mailkite/laravel)PackagistMailKite for PHP[`mailkite-php`](https://github.com/mailkite/mailkite-php)PackagistMailKite for Node.js[`mailkite-node`](https://github.com/mailkite/mailkite-node)npmMailKite for Python[`mailkite-python`](https://github.com/mailkite/mailkite-python)PyPIMailKite for Ruby[`mailkite-ruby`](https://github.com/mailkite/mailkite-ruby)RubyGemsMailKite for Java[`mailkite-java`](https://github.com/mailkite/mailkite-java)Maven CentralMailKite for Go[`mailkite-go`](https://github.com/mailkite/mailkite-go)Go modules@mailkite/cli[`mailkite-cli`](https://github.com/mailkite/mailkite-cli)npm@mailkite/mcp[`mailkite-mcp`](https://github.com/mailkite/mailkite-mcp)npmDocs &amp; links
----------------

[](#docs--links)

- 📚 **Documentation:**
- 📦 **This library's guide:**
- 🤖 **AI agents (MCP + inbox agents):**
- 🌐 **Website:**

MIT licensed. © MailKite.

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

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

---

Tags

emailmailphpphp-mailphp-mailerphpmailerphpmailer-librarylaravelmailemailmailerwebhooktransactionalsymfony mailerinbound emailmailkite

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

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

The Illuminate Mail package.

5910.7M579](/packages/illuminate-mail)[illuminate/notifications

The Illuminate Notifications package.

483.1M1.2k](/packages/illuminate-notifications)[mailersend/laravel-driver

MailerSend Laravel Driver

91933.8k10](/packages/mailersend-laravel-driver)

PHPackages © 2026

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