PHPackages                             uguranyum/yii2-manual-sendmail-command - 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. uguranyum/yii2-manual-sendmail-command

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

uguranyum/yii2-manual-sendmail-command
======================================

Send mail to users from command line for the Yii framework!

v2.5(9y ago)021MITPHP

Since Jul 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/uguranyum/yii2-manual-sendmail-command)[ Packagist](https://packagist.org/packages/uguranyum/yii2-manual-sendmail-command)[ RSS](/packages/uguranyum-yii2-manual-sendmail-command/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

iCalender Extension for Yii2 PHP Framework
==========================================

[](#icalender-extension-for-yii2-php-framework)

REQUIREMENTS
------------

[](#requirements)

Yii2 PHP Framework Yii2 Swiftmailler Extension

DOWNLOAD VIA COMPOSER
---------------------

[](#download-via-composer)

```
composer require uguranyum/yii2-manual-sendmail-command

```

MIGRATE TO DATABASE
-------------------

[](#migrate-to-database)

```
yii migrate --migrationPath=@vendor/uguranyum/yii2-manual-sendmail-command/migration --interactive=0

```

USING EXTENSION
---------------

[](#using-extension)

This extension you must be import your mail list to 'mail\_list' table. Cloumns are: 'email','special\_id','template','json\_values' and'create\_date'.

For example you want to reset users password:

```
$users      = Yii::$app->db2->createCommand('SELECT * FROM `users`')->queryAll();

foreach($users as $user)
{
    $sendmail       =   new Sendmail();
    $email          =   $user['email'];
    $special_id     =   $user['id'];
    $template       =   10;             // Your template number. You can make false...
    $create_date    =   time();         // Created user date.
    $password       =   rand(9999999,99999999999); // Create simple random password

    $verification_code    = $sendmail->generateVerificationCode(10); //if you need just help.

    Yii::$app->db2->createCommand()->update('users', [
            'password'          =>  md5($password),              //new md5 password
            'verification_code' =>  $verification_code,          //new verification code
        ], 'id = '.$user['id'])->execute();

    $json_values    =   json_encode(['username' => $user['username'], 'password' => $password ]);

    $sendmail->saveDb($email, $special_id, $template, $json_values, $create_date);
}

```

This code you are importing users with new password.

Usage the swiftmailler: Add the following code in your application configuration,

```
return [
    //....
    'components' => [
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
        ],
    ],
];

```

Configure the mail settings: In the components's section of your common/main-local.php

```
'mail' => [
        'class' => 'yii\swiftmailer\Mailer',
        'viewPath' => '@backend/mail',
        'useFileTransport' => false,//set this property to false to send mails to real email addresses
        //comment the following array to send mail using php's mail function
        'transport' => [
            'class' => 'Swift_SmtpTransport',
            'host' => 'smtp.gmail.com',
            'username' => 'username@gmail.com',
            'password' => 'password',
            'port' => '587',
            'encryption' => 'tls',
                        ],
    ],
],

```

Use the sample template:

```
path\vendor\uguranyum\yii2-manual-sendmail-command\stemplate\alltemplates.php (all template documents)
Copy to:
path\common\mail\

```

HOW TO USE
----------

[](#how-to-use)

You can use extension in your controller like this:

```
    $sendmail       = new Sendmail();
    $this->saveDb();
    $sendmail->run();
    //$sendmail->turnicateMailList();

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~1 days

Total

4

Last Release

3582d ago

Major Versions

0.0.1alpha → v2.02016-07-21

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

Userssendmailcommandline

### Embed Badge

![Health badge](/badges/uguranyum-yii2-manual-sendmail-command/health.svg)

```
[![Health](https://phpackages.com/badges/uguranyum-yii2-manual-sendmail-command/health.svg)](https://phpackages.com/packages/uguranyum-yii2-manual-sendmail-command)
```

###  Alternatives

[xetaio/xetaravel-mentions

A package to parse a @mention from a text and mention the user with a notification.

58427.6k1](/packages/xetaio-xetaravel-mentions)[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[swissup/module-email

Magento2 email providers integration (smtp, mandrill, amazon ses)

1412.8k1](/packages/swissup-module-email)

PHPackages © 2026

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