Download the PHP package ez-php/mail without Composer

On this page you can find all versions of the php package ez-php/mail. 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 mail

ez-php/mail

Transactional mail module for the ez-php framework. Delivers outgoing messages via a pluggable driver — SMTP (native PHP, no library required), Log (dev/CI), or Null (silent discard).


Installation


Quick Start

Register the provider in provider/modules.php:

Add config values to config/mail.php:

Send a message:


Drivers

Driver MAIL_DRIVER Description
SMTP smtp Delivers via a real SMTP server (RFC 5321, pure PHP)
Mailgun mailgun Mailgun v3 REST API via cURL; no third-party SDK
SendGrid sendgrid SendGrid v3 Mail Send API via cURL; no third-party SDK
Log log Writes a summary to a log file; safe for dev/CI
Null null Silently discards every message (default)

SMTP

Supports TLS via STARTTLS (port 587), implicit SSL (port 465), and plain-text (port 25). Authentication is AUTH LOGIN; omit MAIL_USERNAME to skip authentication.

Mailgun

Delivers via the Mailgun HTTP API v3. US region uses api.mailgun.net; EU region uses api.eu.mailgun.net. Attachments are sent as multipart/form-data.

SendGrid

Delivers via the SendGrid v3 Mail Send API. Attachments are base64-encoded and sent inline in the JSON payload.

Log

When MAIL_LOG_PATH is empty, messages are written via error_log().


Mailable

Mailable is a fluent builder that can be used inline or extended per-message type:

Methods

Method Description
to(string $address, string $name = '') Set recipient
from(string $address, string $name = '') Override sender (uses driver default when not called)
subject(string $subject) Set subject line
text(string $body) Set plain-text body
html(string $body) Set HTML body
attach(string $path, string $name = '') Add file attachment

Combining text() and html() produces a multipart/alternative message. Adding attachments wraps the content in multipart/mixed.


Static Facade

Mail::send(Mailable $mailable) delegates to the driver bound by MailServiceProvider.

In tests, inject a spy driver directly:


MIME Support

MimeBuilder constructs RFC 2822 / MIME messages internally. It handles:


Queue Integration

Mail delivery is synchronous by default — Mail::send() blocks until the driver finishes. To dispatch mail asynchronously, wrap the call in a queue job:

The Mailable is serialized with the job. Mail::send() inside handle() uses whatever driver is registered in the worker process — typically SmtpDriver in production and NullDriver or LogDriver in development.

Note: Queue-backed delivery is an application-layer concern. The ez-php/mail package has no dependency on ez-php/queue.


Local Development with Mailpit

Mailpit is a local SMTP mail catcher with a web UI. All outgoing mail is captured and displayed without being delivered to real recipients.

1 — Add Mailpit to docker-compose.yml

2 — Configure the SMTP driver to point at Mailpit

3 — Open the Mailpit web UI

Navigate to http://localhost:8025 in your browser. Every message sent via Mail::send() appears here instantly.

4 — SMTP integration tests

To run the Mailpit smoke tests in ez-php/mail itself:

The three Mailpit tests are skipped automatically when MAILPIT_HOST is not set.


All versions of mail with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ez-php/contracts Version ^2.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 ez-php/mail contains the following files

Loading the files please wait ...