Download the PHP package julienramel/cloudflare-mailer without Composer

On this page you can find all versions of the php package julienramel/cloudflare-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cloudflare-mailer

Cloudflare Mailer

Tests

Symfony Mailer bridge for Cloudflare Email Service.

Note: Cloudflare Email Sending is currently in public beta. The API may evolve before general availability. Pin your dependency to a specific version of this package.

Requirements

Installation

Configuration

DSN

Part Description
ACCOUNT_ID Your Cloudflare Account ID
API_TOKEN A Cloudflare API token with Email Sending permission

Symfony Mailer (config/packages/mailer.yaml)

Register the transport factory (config/services.yaml)

Usage

Handling bounces

Unlike most email providers (which report bounces asynchronously via webhooks), Cloudflare includes permanent bounce information directly in the API response. This bridge surfaces it via a Symfony event so your application can react immediately.

How it works

A bounce — even a total one — is a business failure, not a transport failure. The API call itself succeeded. No exception is thrown; your listener decides what to do.

Registering the listener

Treating a total bounce as a fatal error

If your use case requires an exception when nobody received the email, throw it yourself inside the listener:

Inspecting results without a listener

SentMessage::getDebug() always contains a human-readable summary visible in the Symfony web profiler:

Supported features

Feature Supported
Plain text body
HTML body
CC / BCC
Reply-To
Attachments
Inline images (cid:)
Custom headers
Bounce detection ✅ (synchronous, via event)
SMTP ❌ (API only)

Known limitations

Recipient display names are not supported. The Cloudflare REST API only accepts plain email addresses for to, cc, and bcc fields. If you set new Address('[email protected]', 'John Doe') as a recipient, only [email protected] will be sent — the display name John Doe will not appear in the delivered email's To header.

The sender (from) supports display names via the {"address": "...", "name": "..."} format.

Maximum 50 recipients combined across to, cc, and bcc. An InvalidArgumentException is thrown before the API call if this limit is exceeded.

Single Reply-To address. If multiple reply-to addresses are set, only the first one is sent.

Domain setup

Before sending, your domain must be onboarded in Cloudflare Email Sending. Cloudflare will add the necessary DNS records (MX, SPF, DKIM, DMARC) automatically. See the official documentation.

Development

License

MIT — see LICENSE.


All versions of cloudflare-mailer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/mailer Version ^6.4|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package julienramel/cloudflare-mailer contains the following files

Loading the files please wait ...