PHPackages                             mateusjunges/laravel-cloudflare-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. mateusjunges/laravel-cloudflare-mail

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

mateusjunges/laravel-cloudflare-mail
====================================

Cloudflare Email Service transport for Laravel.

v1.0.1(2w ago)659↑50%MITPHPPHP ^8.4CI passing

Since May 15Pushed 2w agoCompare

[ Source](https://github.com/mateusjunges/laravel-cloudflare-mail)[ Packagist](https://packagist.org/packages/mateusjunges/laravel-cloudflare-mail)[ Docs](https://github.com/mateusjunges/laravel-cloudflare-mail)[ GitHub Sponsors](https://github.com/mateusjunges)[ RSS](/packages/mateusjunges-laravel-cloudflare-mail/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Laravel Cloudflare Mail
=======================

[](#laravel-cloudflare-mail)

[![Packagist Version](https://camo.githubusercontent.com/adbd1a337ad6e05056b5b3599e6ffe6bae4b64a127a0fd10cd02c9b1d4427d41/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61746575736a756e6765732f6c61726176656c2d636c6f7564666c6172652d6d61696c3f6c6162656c3d4c617465737425323076657273696f6e2532306f6e2532305061636b6167697374)](https://camo.githubusercontent.com/adbd1a337ad6e05056b5b3599e6ffe6bae4b64a127a0fd10cd02c9b1d4427d41/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61746575736a756e6765732f6c61726176656c2d636c6f7564666c6172652d6d61696c3f6c6162656c3d4c617465737425323076657273696f6e2532306f6e2532305061636b6167697374)[![Packagist Downloads](https://camo.githubusercontent.com/337b57da52384587906d9c67c30723548c513c75e6ab55aea461478d49222e27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61746575736a756e6765732f6c61726176656c2d636c6f7564666c6172652d6d61696c3f7374796c653d666c6174266c6162656c3d546f74616c253230446f776e6c6f616473)](https://camo.githubusercontent.com/337b57da52384587906d9c67c30723548c513c75e6ab55aea461478d49222e27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61746575736a756e6765732f6c61726176656c2d636c6f7564666c6172652d6d61696c3f7374796c653d666c6174266c6162656c3d546f74616c253230446f776e6c6f616473)[![MIT Licensed](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE)[![Continuous Integration](https://github.com/mateusjunges/laravel-cloudflare-mail/actions/workflows/ci.yml/badge.svg)](https://github.com/mateusjunges/laravel-cloudflare-mail/actions/workflows/ci.yml)

[![Readme Banner](art/readme-banner.png)](art/readme-banner.png)

A Laravel mail driver for [Cloudflare Email Service](https://developers.cloudflare.com/email-service/), the outbound email API on Cloudflare's network. Once installed and configured, every `Mail::send`, queued mailable, and notification routes through Cloudflare via Laravel's mail abstraction.

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

[](#requirements)

PHP 8.4 or newer. Laravel 12 or 13. A Cloudflare account with a verified sender domain and an API token that has the email sending permission.

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

[](#installation)

```
composer require mateusjunges/laravel-cloudflare-mail
```

The service provider auto registers via Laravel's package discovery. No manual registration needed.

Quick start
-----------

[](#quick-start)

Set the credentials in your `.env`:

```
CLOUDFLARE_EMAIL_ACCOUNT_ID=your-account-id
CLOUDFLARE_EMAIL_API_TOKEN=your-api-token
MAIL_MAILER=cloudflare
```

Add the `cloudflare` mailer to `config/mail.php`:

```
'mailers' => [
    // ...
    'cloudflare' => [
        'transport' => 'cloudflare',
    ],
],
```

Add the credentials block to `config/services.php` (the same convention Laravel's built in Postmark and SES drivers follow):

```
'cloudflare' => [
    'account_id' => env('CLOUDFLARE_EMAIL_ACCOUNT_ID'),
    'api_token' => env('CLOUDFLARE_EMAIL_API_TOKEN'),
],
```

That's it. Your existing mailables and notifications will now be delivered through Cloudflare. Any key set on the mailer block overrides the matching value in `services.cloudflare`, which is handy for scoping a second mailer entry to a different account.

Documentation
-------------

[](#documentation)

The `docs/` folder covers each topic in more depth:

- [Installation](docs/installation.md). Composer install and provider registration.
- [Configuration](docs/configuration.md). Environment variables, config files, and Cloudflare dashboard setup.
- [Usage](docs/usage.md). Sending mail through the facade, mailables, notifications, and queued jobs.
- [Error handling](docs/error-handling.md). Exception types, Cloudflare error codes, and retry semantics.

Versioning
----------

[](#versioning)

This package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The public API consists of the `cloudflare` mailer configuration keys and the `Junges\CloudflareMail\Exceptions\CloudflareTransportException` class. Every other class is marked `@internal` and may change in any release, so depend only on the documented configuration and the Laravel mail abstraction.

Testing
-------

[](#testing)

```
composer test
```

The `composer cs` script runs Rector, Pint, and PHPStan together.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for what has changed recently.

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

[](#contributing)

Contributions are welcome. Please open an issue to discuss substantial changes before submitting a pull request, and make sure `composer test` and `composer cs` pass.

Security
--------

[](#security)

If you discover a security vulnerability, please review [our security policy](SECURITY.md) for how to report it.

Credits
-------

[](#credits)

- [Mateus Junges](https://github.com/mateusjunges)
- [All Contributors](https://github.com/mateusjunges/laravel-cloudflare-mail/contributors)

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance96

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

Total

5

Last Release

18d ago

Major Versions

v0.1.0 → v1.0.02026-05-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19756164?v=4)[Mateus Junges](/maintainers/mateusjunges)[@mateusjunges](https://github.com/mateusjunges)

---

Top Contributors

[![mateusjunges](https://avatars.githubusercontent.com/u/19756164?v=4)](https://github.com/mateusjunges "mateusjunges (40 commits)")

---

Tags

laravelmailemailmailertransportcloudflarecloudflare-email-service

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mateusjunges-laravel-cloudflare-mail/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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