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

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

tomahock/laravel-cloudflare-mail
================================

Laravel mail driver for Cloudflare Email Service

v1.0.2(3mo ago)184↓50%MITPHP ^8.1

Since Apr 16Compare

[ Source](https://github.com/tomahock/laravel-cloudflare-mail)[ Packagist](https://packagist.org/packages/tomahock/laravel-cloudflare-mail)[ RSS](/packages/tomahock-laravel-cloudflare-mail/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (8)Versions (4)Used By (0)

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

[](#laravel-cloudflare-mail)

A Laravel mail transport driver for [Cloudflare Email Service](https://developers.cloudflare.com/email-service/).

> **Note:** Cloudflare Email Service is currently in beta. Ensure your account has access before using this package.

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

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

Publish the config file:

```
php artisan vendor:publish --tag=cloudflare-mail-config
```

Configuration
-------------

[](#configuration)

Add the following variables to your `.env` file:

```
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_API_TOKEN=your-api-token
```

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

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

Set it as the default mailer:

```
MAIL_MAILER=cloudflare
```

Usage
-----

[](#usage)

Use Laravel's standard `Mail` facade — no API-specific code required:

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

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

Or with a raw message:

```
Mail::raw('Hello World', function ($message) {
    $message->to('recipient@example.com')
            ->from('sender@yourdomain.com', 'Your App')
            ->subject('Hello');
});
```

Setting Up Cloudflare Email Sending
-----------------------------------

[](#setting-up-cloudflare-email-sending)

Before sending emails, you must configure the Cloudflare Email Sending service in your account:

1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com) and select your account
2. Navigate to **Email** → **Email Sending** (currently in beta — you may need to request access)
3. Add your sender domain (e.g. `yourdomain.com`) and follow the DNS verification steps
4. Add the required DNS records (SPF, DKIM) that Cloudflare provides for your domain

> **Note:** Attempting to send emails before the domain is verified will result in a `500 Internal Server Error` from the API (`email.sending.error.internal_server`).

Creating API Tokens
-------------------

[](#creating-api-tokens)

1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com/) → **My Profile** → **API Tokens**
2. Create a token with **Email Service: Send** permission scoped to your account
3. Copy the token into `CLOUDFLARE_API_TOKEN`

Your `CLOUDFLARE_ACCOUNT_ID` is visible in the URL when logged into the Cloudflare dashboard (`dash.cloudflare.com/{account_id}/...`) or under **Account Home → Overview**.

Supported Features
------------------

[](#supported-features)

FeatureSupportedPlain text body✅HTML body✅CC / BCC✅Reply-To✅Named addresses (`"Name" `)✅File attachments✅Multiple recipients✅Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance81

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

3

Last Release

99d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/794581?v=4)[João Pina](/maintainers/tomahock)[@tomahock](https://github.com/tomahock)

---

Tags

laravelmailemailcloudflaretransactional

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.5k](/packages/laravel-framework)[propaganistas/laravel-disposable-email

Disposable email validator

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

The Illuminate Mail package.

5910.6M528](/packages/illuminate-mail)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

211.4M2.4k](/packages/flarum-core)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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