PHPackages                             miserenkov/yii2-sms - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. miserenkov/yii2-sms

ActiveYii2-component[Utility &amp; Helpers](/categories/utility)

miserenkov/yii2-sms
===================

Yii2 component for sending SMS messages

v1.2.1(6y ago)446.3k↓38.6%4[3 issues](https://github.com/miserenkov/yii2-sms/issues)[1 PRs](https://github.com/miserenkov/yii2-sms/pulls)MITPHPPHP &gt;=5.5.0

Since Dec 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/miserenkov/yii2-sms)[ Packagist](https://packagist.org/packages/miserenkov/yii2-sms)[ RSS](/packages/miserenkov-yii2-sms/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

Yii2 Sms component
==================

[](#yii2-sms-component)

Yii2 component for sending SMS messages through Smsc

[![License](https://camo.githubusercontent.com/0d9d28abe5b7ebc4d052ab2854a087eb5b5800ca6309d1e5fae248e3f83bf465/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d736d732f6c6963656e7365)](https://packagist.org/packages/miserenkov/yii2-sms)[![Latest Stable Version](https://camo.githubusercontent.com/52ddaa8ec775060c66864f1182f9e5ee3c2ac82382ac967396aff8eada1b9633/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d736d732f762f737461626c65)](https://packagist.org/packages/miserenkov/yii2-sms)[![Latest Unstable Version](https://camo.githubusercontent.com/bf659ba5a96e9754e32ba0a40cb29c67c895f59cb6f814696228b151c35573e4/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d736d732f762f756e737461626c65)](https://packagist.org/packages/miserenkov/yii2-sms)[![Total Downloads](https://camo.githubusercontent.com/d0002799924dbb6230759658c82b34c52e2f9a9a3dd84818af5b0011a06181bd/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d736d732f646f776e6c6f616473)](https://packagist.org/packages/miserenkov/yii2-sms)[![Build Status](https://camo.githubusercontent.com/6a79093a3bdf35f66e5c5ec558249977301bda861762ec6a490a061c08285afe/68747470733a2f2f7472617669732d63692e6f72672f6d69736572656e6b6f762f796969322d736d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/miserenkov/yii2-sms)

Support
-------

[](#support)

[GitHub issues](https://github.com/miserenkov/yii2-sms).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist miserenkov/yii2-sms "^1.0"

```

or add

```
"miserenkov/yii2-sms": "^1.0"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

To use sender, you should configure it in the application configuration like the following

```
'components' => [
    ...
    'sms' => [
        'class' => 'miserenkov\sms\Sms',
        'gateway' => 'smsc.ua',     // gateway, through which will sending sms, default 'smsc.ua'
        'login' => '',              // login
        'password' => '',           // password or lowercase password MD5-hash
        'senderName' => '',         // sender name
        'options' => [
            'useHttps' => true,     // use secure HTTPS connection, default true
        ],
    ],
    ...
],
```

#### Available gateways

[](#available-gateways)

```
\miserenkov\sms\Sms::GATEWAY_UKRAINE,     // smsc.ua
\miserenkov\sms\Sms::GATEWAY_RUSSIA,      // smsc.ru
\miserenkov\sms\Sms::GATEWAY_KAZAKHSTAN,  // smsc.kz
\miserenkov\sms\Sms::GATEWAY_TAJIKISTAN,  // smsc.tj
\miserenkov\sms\Sms::GATEWAY_UZBEKISTAN,  // smsc.uz
\miserenkov\sms\Sms::GATEWAY_WORLD,       // smscentre.com
```

#### Messages logging

[](#messages-logging)

```
'components' => [
    ...
    'sms' => [
        ...
        'logging' => [
            'class' => '',          // optionaly, default to miserenkov\sms\logging\Logger
            'connection' => 'db'    // string or array to database connection
            'tableName' => ''       // database table name, optionaly, default to {{%sms_log}}
        ],
        ...
    ],
    ...
],
```

Basic usages
------------

[](#basic-usages)

#### Get balance

[](#get-balance)

```
/**
 * return an float in case of successful or false in case of error
 */
Yii::$app->sms->getBalance();
```

#### Sending message

[](#sending-message)

```
/**
 * $phones an string for single number or array for multiple numbers
 * $message an string
 *
 * return an string sms identifier in case successful or false in case error
 */
Yii::$app->sms->send($phones, $message);
```

#### Get message status

[](#get-message-status)

```
/**
 * $id sms identifier
 * $phone phone number of recipient
 *
 * return an array [
 *      status           - status code
 *      status_message   - status message
 *      err              - error code
 *      err_message      - error message
 *      send_time        - timestamp of send
 *      cost             - message cost
 *      operator         - recipient operator
 *      region           - recipient region
 * ] in case successful or false in case error
 */
Yii::$app->sms->getStatus($id, $phone);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.1% 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 ~400 days

Total

4

Last Release

2299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2da4989419ba449f8a65c166d33be4472ab6a37d3e55092f17e8ac9eba5b3574?d=identicon)[miserenkov](/maintainers/miserenkov)

---

Top Contributors

[![miserenkov](https://avatars.githubusercontent.com/u/12072466?v=4)](https://github.com/miserenkov "miserenkov (49 commits)")[![Gruven](https://avatars.githubusercontent.com/u/410058?v=4)](https://github.com/Gruven "Gruven (1 commits)")[![int64](https://avatars.githubusercontent.com/u/639721?v=4)](https://github.com/int64 "int64 (1 commits)")

---

Tags

smsyii2smscsmsc.rusmsc.ua

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/miserenkov-yii2-sms/health.svg)

```
[![Health](https://phpackages.com/badges/miserenkov-yii2-sms/health.svg)](https://phpackages.com/packages/miserenkov-yii2-sms)
```

###  Alternatives

[daixianceng/yii2-smser

Yii2 SMS extension

882.9k1](/packages/daixianceng-yii2-smser)[saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

1317.0k1](/packages/saviorlv-yii2-dysms)[abhi1693/yii2-sms

Send Free Sms for Yii2

181.9k](/packages/abhi1693-yii2-sms)

PHPackages © 2026

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