PHPackages                             mail-mantra/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. mail-mantra/sms

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

mail-mantra/sms
===============

Send SMS

v1.0.2(1y ago)08MITPHPPHP &gt;=7.3

Since Jul 18Pushed 9mo agoCompare

[ Source](https://github.com/mail-mantra/sms)[ Packagist](https://packagist.org/packages/mail-mantra/sms)[ Docs](https://github.com/mail-mantra/sms)[ RSS](/packages/mail-mantra-sms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (0)

MM SMS
======

[](#mm-sms)

[![Stable](https://camo.githubusercontent.com/bfefce7068adcf1bf93300ea070f46ce227ea631cf473b1cacb763da280e1846/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652d76312e302e322d626c75652e737667)](https://packagist.org/packages/milan-sahana/mm-sms#1.0.2) [![License](https://camo.githubusercontent.com/5165e68d33f21abd3faeaf6d79b29c80ace6a652fbf4ecec6783202a8c7ad7ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d323042324141)](LICENSE)

A simple library to send SMS using MM Sms Service

Official PHP library for [Mail Mantra SMS](https://sms1.mailmantra.com/v2).

Read up here for getting started and understanding the sms flow with MM Sms:

### Prerequisites

[](#prerequisites)

- A minimum of PHP 7.3 upto 8.3

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

[](#installation)

- If your project using composer, run the below command

```
composer require mail-mantra/sms

```

- If you are not using composer, download the latest release from [the releases section](https://github.com/mail-mantra/sms/releases).

\##Note: This PHP library follows the following practices:

- Namespaced under `MM\Sms`
- API throws exceptions instead of returning errors
- Options are passed as an array instead of multiple arguments wherever possible
- All requests and responses are communicated over JSON

Documentation
-------------

[](#documentation)

Documentation of MM SMS's API and their usage is available at

Basic Usage
-----------

[](#basic-usage)

Instantiate the MM Sms instance with `auth_key`. You can obtain the keys from the dashboard app (https://sms1.mailmantra.com/v2/sender\_id/list\_all)

```
use MailMantra\Sms\Sms;

$mmSMS = new Sms($auth_key);
```

The resources can be accessed via the `$mmSMS` object. All the methods invocations follows the following pattern

```
    // $mmSMS->function() to access the API
    //Example
    $mmSMS->send('9876543210', '1234 is Your OTP. Do not share with anyone.','123456789101112');
```

Common Examples
===============

[](#common-examples)

### View Balance:

[](#view-balance)

To view your balance

```
use MilanSahana\MmSms\Sms;

$mmSMS = new Sms("JFDG231HFDJ34KGH8438DSUG4FUD8SG");

$balance_arr = $mmSMS->balance();

var_dump($balance_arr);
```

##### Output:

[](#output)

```
array(3) {
    ["status"]=>
  int(1)
  ["message"]=>
  string(1) "7"
    ["code"]=>
  string(6) "MMTEST"
}
```

### Send sms:

[](#send-sms)

Send a sms to one or more mobile number(comma seperated mobile numbers)

```
use MilanSahana\MmSms\Sms;

$mmSMS = new Sms("JFDG231HFDJ34KGH8438DSUG4FUD8SG");

$send_report = $mmSMS->send('9876543210', '123456 is Your OTP. Do not share with anyone.','12345678901234567890');

var_dump($send_report);
```

##### Output:

[](#output-1)

```
array(3) {
    ["status"]=>
  int(1)
  ["message"]=>
  string(25) "1 SMS send Successfully.."
    ["code"]=>
  string(24) "346772774568353130393036"
}
```

### Send Bulk sms:

[](#send-bulk-sms)

Send a sms to one or more mobile number(comma seperated mobile numbers)

```
use MilanSahana\MmSms\Sms;

$mmSMS = new Sms("JFDG231HFDJ34KGH8438DSUG4FUD8SG");

$sms = [
    [
        'message' =>'1234 Your OTP. Do not share with anyone.',
        'to'=>[
            '9999999999',
            '8888888888',
        ]
    ],
    [

        'message' =>'56789 Your OTP. Do not share with anyone.',
        'to'=>[
            '7777777777',
            '9876543210'
        ]
    ],
];

$send_bulk_report = $mmSMS->sendBulk($sms, '12345678901234567890');

var_dump($send_bulk_report);
```

##### Output:

[](#output-2)

```
array(3) {
    ["status"]=>
  int(1)
  ["message"]=>
  string(25) "4 SMS send Successfully.."
    ["code"]=>
  string(24) "346772774163393934343834"
}
```

Changelog
---------

[](#changelog)

#### Version 1.0.1 provided by [milan-sahana](https://github.com/milan-sahana) - *Testing*

[](#version-101-provided-by-milan-sahana---testing)

- Cleaned Up Code
- Fixed Bugs
- A minimum of PHP 7.3
- Added Option to prevent json error

##### Version 1.0.0 - *Stable Release*

[](#version-100---stable-release)

- View Balance
- Added Send SMS in Bulk
- Fixed issue Send SMS
- Update extras array
- Updating version pattern.

```
x.y.z
x = Main version of the plugin
y = New features were added to the plugin
z = Fixes/patches to existing features of the plugin

```

License
-------

[](#license)

The MM SMS PHP SDK is released under the MIT License. See [LICENSE](LICENSE) file for more details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance48

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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 ~0 days

Total

3

Last Release

658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5996b0d4d5eb91dea6ccc4c3a478e6791f8953e7b2366293e31ae3310b5f6124?d=identicon)[milansahana](/maintainers/milansahana)

---

Top Contributors

[![milan-sahana](https://avatars.githubusercontent.com/u/14888119?v=4)](https://github.com/milan-sahana "milan-sahana (19 commits)")

### Embed Badge

![Health badge](/badges/mail-mantra-sms/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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