Download the PHP package tomahock/laravel-cloudflare-mail without Composer
On this page you can find all versions of the php package tomahock/laravel-cloudflare-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tomahock/laravel-cloudflare-mail
More information about tomahock/laravel-cloudflare-mail
Files in tomahock/laravel-cloudflare-mail
Package laravel-cloudflare-mail
Short Description Laravel mail driver for Cloudflare Email Service
License MIT
Informations about the package laravel-cloudflare-mail
Laravel Cloudflare Mail
A Laravel mail transport driver for Cloudflare Email Service.
Note: Cloudflare Email Service is currently in beta. Ensure your account has access before using this package.
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
Installation
Publish the config file:
Configuration
Add the following variables to your .env file:
Configure the mailer in config/mail.php:
Set it as the default mailer:
Usage
Use Laravel's standard Mail facade — no API-specific code required:
Or with a raw message:
Setting Up Cloudflare Email Sending
Before sending emails, you must configure the Cloudflare Email Sending service in your account:
- Go to Cloudflare Dashboard and select your account
- Navigate to Email → Email Sending (currently in beta — you may need to request access)
- Add your sender domain (e.g.
yourdomain.com) and follow the DNS verification steps - 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 Errorfrom the API (email.sending.error.internal_server).
Creating API Tokens
- Go to Cloudflare Dashboard → My Profile → API Tokens
- Create a token with Email Service: Send permission scoped to your account
- 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
| Feature | Supported |
|---|---|
| Plain text body | ✅ |
| HTML body | ✅ |
| CC / BCC | ✅ |
| Reply-To | ✅ |
Named addresses ("Name" <email>) |
✅ |
| File attachments | ✅ |
| Multiple recipients | ✅ |
Running Tests
License
MIT
All versions of laravel-cloudflare-mail with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
symfony/mailer Version ^6.0|^7.0
symfony/mime Version ^6.0|^7.0
guzzlehttp/guzzle Version ^7.0