Download the PHP package andrewdyer/mailer without Composer

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

Mailer

A framework-agnostic library for sending emails from Twig templates, with support for a swappable transport interface.

Latest Stable Version Total Downloads License PHP Version Require

Introduction

This library renders Twig templates to HTML and dispatches them through an extensible, swappable transport interface, with a Symfony Mailer transport included out of the box. Custom transports can be introduced by implementing a simple contract, making it straightforward to adapt the delivery pipeline to different mailing backends or infrastructure requirements.

Prerequisites

Installation

Getting Started

1. Create a Twig template

Create an HTML template in the application's templates directory:

2. Create a mailable

Extend Mailable and implement envelope() to configure the routing and content() to define the template and data:

3. Set up the mailer

Instantiate Mailer with a Twig\Environment, a transport, and an optional default from address:

Usage

Sending a mailable

Dispatch any Mailable instance via the send() method:

Attaching files

Implement AttachableInterface on the mailable and return an array of absolute file paths:

Envelope

A value object defining the routing and metadata for a message. Only to and subject are required — all other properties are optional and can be passed in any order using named arguments:

Setting a from address

The defaultFrom address set on Mailer is used when from is omitted. Set it explicitly on the Envelope to override it for a specific mailable:

Adding CC and BCC recipients

Pass arrays of Address instances to cc and bcc on the Envelope:

Setting priority

Pass a Priority enum value to priority on the Envelope:

Transports

Symfony Mailer

A transport backed by Symfony Mailer, supporting SMTP and a wide range of third-party providers via DSN strings.

Then instantiate the transport with a DSN string:

Common DSN formats:

Custom transports

Any class implementing TransportInterface can be used as a transport, accepting a PreparedMessage and dispatching it:

License

Licensed under the MIT licence and is free for private or commercial projects.


All versions of mailer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
twig/twig Version ^3.27
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 andrewdyer/mailer contains the following files

Loading the files please wait ...