Download the PHP package yiisoft/yii2-symfonymailer without Composer

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

Yii Mailer Library - Symfony Mailer Extension


This extension provides a Symfony Mailer mail solution for Yii framework 2.0.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status codecov static analysis type-coverage

Requirements

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json.

Usage

To use this extension, simply add the following code in your application configuration:

or

You can then send an email as follows:

DI Container

The Mailer component will automatically use the DI container when it is available. This allows you to easily override the transport factory configurations or their dependencies.

Migrating from yiisoft/yii2-swiftmailer

To migrate from the deprecated yiisoft/yii2-swiftmailer to this extension you need to update the application config.

Swiftmailer default transport was the SendmailTransport, while with this extension it will default to a NullTransport (sends no mail). You can use the swiftmailer default like the following:

With this extension, you do not have an ability of directly setting timeout, or other configurations that were possible with Swiftmailer extension. The reason is, the underlying Symfony package defines its classes as final thereby discouraging inheritance and pushing towards composition.

To achieve timeout, for example (and other transport configurations supported), you will need to define factory class and override default transport factory you are interested to replace through Yii DI container definitions.

Below is an example that shows you how to ovveride timeout.

First define your custom factory class.

Then in the root of web configuration, set the factory class in container definitions, thereby overriding the default class.

That is all you need to do. The extension should use your new class and its configuration settings.

Security implications of the DSN

While the DSN might seem like a simple way to allow user configurable mailer settings it should be noted that the sendmail transport allows for execution of local executables. If you need to have a user configurable DSN (which is easier to build and more powerful to use than creating a GUI) you should probably disable the sendmail transport. Any user who has the power to configure a DSN essentially has shell access to wherever the code is running.

Testing

Check the documentation testing to learn about testing.


All versions of yii2-symfonymailer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/event-dispatcher Version 1.0.0
symfony/mailer Version ^6.4 || ^7.0
symfony/mime Version ^6.4 || ^7.0
yiisoft/yii2 Version >=2.0.4
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 yiisoft/yii2-symfonymailer contains the following files

Loading the files please wait ....