Download the PHP package zfr/zfr-mail without Composer

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

ZfrMail

Build Status

ZfrMail is a lightweight abstraction around common mail API. It provides only a way to send a message (or templated mail if the provider

Dependencies

Installation

Installation of ZfrMail is only officially supported using Composer:

Usage

Creating a mail

The first thing is to create a mail. Mails are immutable and follow a similar logic to PSR-7 objects. There are two different kinds of mails in ZfrMail:

For instance, here is how you can create a simple rendered email:

And a templated email:

Mail can also accepts options. Those options are specific to the mail provider you're using. For instance, if you are using Postmark, the accepted options are (we're following Postmark convention on naming to make it easy):

Configuring a mailer

For now, ZfrMail provides integration with Postmark and Amazon SES.

Postmark

In order to configure Postmark, add the following code to your config:

The server token can be found in your Postmark account.

Amazon SES

In order to configure Amazon SES, add the following code to your config:

You have to had those dependencies in order to use Amazon SES :

Using the mailer

You can now inject the ZfrMail\Mailer\PostmarkMailer or ZfrMail\Mailer\AwsSesMailer class into your services. Those class comes with a single send method. The mailer will automatically either send a templated or rendered mail for you:

Mailer also returns the message ID of the underlying platform (if supported). This can be useful if you need to implement features such as open tracking, where you would need to save into your database the message ID of the mailer:

ZfrMail is meant to be a lightweight solution with minimal overhead. As a consequence, it does not any validation to check whether your email addresses are valid, or if you are properly formatting the options according to your chosen provider.

To-do


All versions of zfr-mail with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
guzzlehttp/guzzle Version ^6.0
psr/container Version ^1.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 zfr/zfr-mail contains the following files

Loading the files please wait ....