PHPackages                             devster/rad-mailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. devster/rad-mailer

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

devster/rad-mailer
==================

Symfony rad mailer

1.0.0(11y ago)6411MITPHPPHP &gt;=5.3.3

Since Aug 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/devster/rad-mailer)[ Packagist](https://packagist.org/packages/devster/rad-mailer)[ Docs](https://github.com/devster/rad-mailer)[ RSS](/packages/devster-rad-mailer/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

RAD Mailer
==========

[](#rad-mailer)

[![Build Status](https://camo.githubusercontent.com/00f8e8c92bf153ff34d36f8ba040ae05cd20dbf62b6c897d68cb4437a8929085/68747470733a2f2f7472617669732d63692e6f72672f646576737465722f7261642d6d61696c65722e737667)](https://travis-ci.org/devster/rad-mailer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/41698bc4c58ac8c2e174012ad57b31c4a2d683f55c7f557111aa4be370e7c6d1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646576737465722f7261642d6d61696c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/devster/rad-mailer/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/5dd79d67c72dcdf57db89cf4404e5d25eea8bbcc1cebc38dedd021bc757541a4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646576737465722f7261642d6d61696c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/devster/rad-mailer/?branch=master)[![PHP version](https://camo.githubusercontent.com/1b5d76e8cd5534f10a359aa8100e22e0e2c5fe724abe3abee5f65fcc58d7819a/68747470733a2f2f62616467652e667572792e696f2f70682f646576737465722532467261642d6d61696c65722e737667)](http://badge.fury.io/ph/devster%2Frad-mailer)

**Send Twig templated email with Swiftmailer at speed of light. Dead simple.**

[![](https://camo.githubusercontent.com/b937cc4248504721d76a5d1ee7e00ef08fc1697ff7953079a532c596236b2bc9/687474703a2f2f7777772e7265616374696f6e676966732e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031312f30392f6d696e645f626c6f776e2e676966)](http://www.reactiongifs.com/wp-content/uploads/2011/09/mind_blown.gif)

Installation
------------

[](#installation)

### Composer

[](#composer)

Add this to your composer.json

```
{
    "require": {
        "devster/rad-mailer": "~1.0"
    }
}
```

Usage
-----

[](#usage)

### Global usage

[](#global-usage)

```
// twig is optional, like from
$mailer = new Rad\Mailer($swiftmailer, $twig, $from = 'john@example.com');

// Send a simple email
$nbEmailsSent = $mailer->send(array(
    // Optional. By default the value set in the constructor.
    // 'bob@example.com', array('bob@example.com' => 'Bob', ...)
    // or an object (see more details below)
    'from'      => 'bob@example.com',
    // Same as from
    'to'        => 'robert@example.com',
    // A twig template as string or a twig file template (ex: email.html.twig)
    'subject'   => 'Hello {{name}}!',
    // Same as subject
    'body'      => 'body.html.twig',
    // Optional. The data used in both templates subject and body
    'data'      => array('name' => 'Rob'),
    // Optional, default: text/html. 'text/html' or 'text/plain'
    'body_type' => 'text/plain'
));

// Send a more complex email
// Create a \Swift_Message pre set with data
$message = $mailer->createMessage(array(
    'to'        => 'robert@example.com',
    'subject'   => 'Hello {{name}}!',
    'body'      => 'body.html.twig',
    'data'      => array('name' => 'Rob'),
));

$message->attach(\Swift_Attachment::fromPath('/path/to/image.jpg'));

$nbEmailsSent = $mailer->sendMessage($message);
```

This library is aims to work with symfony, so you can pass an object as `from` and `to` option. This object must has:

```
* an `email` public property
* or `mail` public property
* or a `getEmail` public method
* or a `getMail` public method
* and a `name` public property
* or a `getName` public method
* or a `__toString` public method

```

Or you can extends the `getDataFromObject` method from the `Rad\Mailer`.

### Symfony

[](#symfony)

Register the mailer as service

```
services:
    rad_mailer:
        class: Rad\Mailer
        arguments: [@mailer, @twig, 'rob@example.com']
```

Why not a bundle? Because its overkill. period.

### Silex

[](#silex)

```
$app = new \Silex\Application;

$app->register(new \Silex\Provider\SwiftmailerServiceProvider, ...);
$app->register(new \Silex\Provider\TwigServiceProvider, ...);

$app->register(new \Rad\Silex\MailerServiceProvider, array(
    'rad_mailer.from'  => 'rob@example.com', // Optional
    'rad_mailer.class' => 'MyMailer\That\Extends\Rad\Mailer', // Optional. By default 'Rad\Mailer' of course
));

$app['rad_mailer']->send(array(...));
```

License
-------

[](#license)

This plugin is licensed under the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8620f3809131894195e57dcaf70f3468f009b39dd4ebf220a964f580c38afc80?d=identicon)[devster](/maintainers/devster)

---

Top Contributors

[![devster](https://avatars.githubusercontent.com/u/1135083?v=4)](https://github.com/devster "devster (9 commits)")[![t-geindre](https://avatars.githubusercontent.com/u/6348039?v=4)](https://github.com/t-geindre "t-geindre (1 commits)")

---

Tags

mailerrad

### Embed Badge

![Health badge](/badges/devster-rad-mailer/health.svg)

```
[![Health](https://phpackages.com/badges/devster-rad-mailer/health.svg)](https://phpackages.com/packages/devster-rad-mailer)
```

###  Alternatives

[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[fedeisas/laravel-mail-css-inliner

Inline the CSS of your HTML emails using Laravel

5974.6M3](/packages/fedeisas-laravel-mail-css-inliner)[sylius/mailer-bundle

Mailers and e-mail template management for Symfony projects.

728.1M77](/packages/sylius-mailer-bundle)[voku/bounce-mail-handler

Bounce Mail Handler

49230.9k2](/packages/voku-bounce-mail-handler)[nickcv/yii2-mandrill

Mandrill Api Integration for Yii2

29554.2k2](/packages/nickcv-yii2-mandrill)[phalcon-ext/mailer

Mailer component as wrapper over SwiftMailer for Phalcon.

39196.9k2](/packages/phalcon-ext-mailer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
