PHPackages                             janisto/yii-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. janisto/yii-mailer

ArchivedLibrary[Mail &amp; Notifications](/categories/mail)

janisto/yii-mailer
==================

Yii Component for Swift Mailer

1.0.0(12y ago)5124.0k1public domainPHPPHP &gt;=5.1.0

Since Nov 15Pushed 12y ago1 watchersCompare

[ Source](https://github.com/janisto/yii-mailer)[ Packagist](https://packagist.org/packages/janisto/yii-mailer)[ Docs](https://github.com/janisto/yii-mailer)[ RSS](/packages/janisto-yii-mailer/feed)WikiDiscussions master Synced yesterday

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

yii-mailer
==========

[](#yii-mailer)

Yii Component for Swift Mailer

- [Documentation](http://swiftmailer.org/docs/messages.html)
- [Github Project Page](https://github.com/janisto/yii-mailer/)

Requirements
------------

[](#requirements)

- Yii 1.1.14 or above
- [Composer](http://getcomposer.org/doc/)

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

[](#installation)

- Require the package.

```
{
	"name": "app-name",
	"description": "App description",
	"type": "project",
	"prefer-stable": true,
	"require": {
		"php": ">=5.3.0",
		"yiisoft/yii": "1.1.14",
		"janisto/yii-mailer": "1.0.0"
	}
}
```

- Include Composer autoloader before Yii in your entry script (index.php and/or yiic.php for console scripts).

```
// Composer autoload
$composerAutoload = dirname(__FILE__) . '/../vendor/autoload.php';
require_once($composerAutoload);
...
```

- Add vendor path to your configuration file, attach component and set properties.

```
	'aliases'=>array(
		'vendor' => realpath(__DIR__ . '/../../vendor'),
	),
	'components' => array(
		...
		'mailer' => array(
			'class' => 'vendor.janisto.yii-mailer.SwiftMailerComponent',
			'type' => 'smtp',
			'host' => 'email-smtp.us-east-1.amazonaws.com',
			'port' => 587,
			'username' => 'xxx',
			'password' => 'yyy',
			'security' => 'tls',
			'throttle' => 5*60,
		),
		...
	),
```

Usage
-----

[](#usage)

```
$message = Yii::app()->mailer
	->createMessage('Your subject', 'Here is the message itself')
	->setFrom(array('from@domain.com' => 'From Name'))
	->setTo(array('to@domain.com' => 'To Name'));

Yii::app()->mailer->send($message);
```

or

```
$failures = array();
$sent = 0;
$from = array('from@domain.com' => 'From Name');
$emails = array(
	array('to@domain.com' => 'To Name'),
	array('receiver@bad-domain.org' => 'To Name'),
	array('other-receiver@bad-domain.org' => 'To Name'),
);

/* @var Swift_Message $message */
$message = Yii::app()->mailer
	->createMessage('Your subject')
	->setFrom($from)
	->setBody('Here is the message itself')
	->addPart('Here is the message itself', 'text/html');

foreach ($emails as $to) {
	$message->setTo($to);
	try {
		$sent += Yii::app()->mailer->send($message, $failures);
	} catch (Exception $e) {
		// SMTP server not responding or limit exceeded?
		echo $e->getMessage();
	}
}

echo "$sent emails sent.\n";
echo "Failures:\n";
print_r($failures);
```

Changelog
---------

[](#changelog)

### v1.0.0

[](#v100)

- Initial version.

License
-------

[](#license)

yii-mailer is free and unencumbered [public domain](http://unlicense.org/) software.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

4561d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d07415b7ffb6fd46509d1a3eb7873068b7fe5eca5da0cc2f0f6b4c3e66932ab3?d=identicon)[janisto](/maintainers/janisto)

---

Top Contributors

[![janisto](https://avatars.githubusercontent.com/u/387868?v=4)](https://github.com/janisto "janisto (8 commits)")

---

Tags

mailmailerextensionyiiswift

### Embed Badge

![Health badge](/badges/janisto-yii-mailer/health.svg)

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

###  Alternatives

[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28160.6k](/packages/boundstate-yii2-mailgun)[djagya/yii2-sparkpost

A library provides Yii2 integration with SparkPost mail service

1816.3k](/packages/djagya-yii2-sparkpost)

PHPackages © 2026

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