Abstracts mailer service communication, such as Mandrill and Amazon SES

2.0.0 2015-12-03 20:44 UTC

This package is auto-updated.

Last update: 2020-10-15 23:04:46 UTC


Latest Stable Version License Build Status Scrutinizer Code Quality

Linio Mail is yet another component of the Linio Framework. It aims to abstract email messaging by supporting multiple adapters.


The recommended way to install Linio Mail is through composer.

$ composer install linio/mail


To run the test suite, you need install the dependencies via composer, then run PHPUnit.

$ composer install
$ vendor/bin/phpunit


The library is very easy to use: first, you have to register the service. For Silex, a service provider is included. Just register it:


$app->register(new \Linio\Component\Mail\Provider\MailServiceProvider(), [
    'mail.adapter_name' => 'mandrill',
    'mail.adapter_options' => [
        'api_key' => '',

Note that must provide an adapter name and an array of options. Each adapter has different configuration options that are injected by the AdapterFactory.

To start sending messages:


use Linio\Component\Mail\Message;
use Linio\Component\Mail\Contact;

$message = new Message();
$message->setSubject('hello world');
$message->setFrom(new Contact('Barfoo', ''));
$message->addTo(new Contact('Foobar', ''));
$message->setData(['id' => '1']);