PHPackages                             jandreasn/an-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. jandreasn/an-sms

Abandoned → [andreasnij/an-sms](/?search=andreasnij%2Fan-sms)Library[Mail &amp; Notifications](/categories/mail)

jandreasn/an-sms
================

A PHP library to send and receive SMS text messages through various gateways/providers.

2.0(2mo ago)922.2k3[1 issues](https://github.com/andreasnij/an-sms/issues)MITPHPPHP &gt;=8.2CI passing

Since May 7Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/andreasnij/an-sms)[ Packagist](https://packagist.org/packages/jandreasn/an-sms)[ Docs](https://github.com/andreasnij/an-sms)[ RSS](/packages/jandreasn-an-sms/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (22)Versions (14)Used By (0)

AnSms - A PHP SMS library
=========================

[](#ansms---a-php-sms-library)

[![Version](https://camo.githubusercontent.com/235c5306c93b5aff6ebdfdcfe23cd6fa51360b7a2bde8b1d0afb99c658972458/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e64726561736e696a2f616e2d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andreasnij/an-sms)

An extendable library for sending and receiving SMS messages.

Supported SMS gateways
----------------------

[](#supported-sms-gateways)

Send SMSDelivery reportsReceive SMSPremium SMS[46elks](https://46elks.com/)✔✔✔[Cellsynt](https://www.cellsynt.com)✔✔✔✔[Vonage (formerly Nexmo)](https://www.vonage.com)✔✔✔[Twilio](https://www.twilio.com)✔✔✔[Telenor SMS Pro](https://www.smspro.se/)✔✔You can add and use your own gateway. This library enables easy switching between different gateways.

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

[](#installation)

Add the package as a requirement to your `composer.json`:

```
$ composer require andreasnij/an-sms
```

If you want to use the **46elks**, **Cellsynt** or **Telenor SMS Pro** gateway you also you need implementations of PSR-7: HTTP message interfaces, PSR-17: HTTP Factories and PSR-18: HTTP Client. A popular package for this is Guzzle. You can install it with:

```
$ composer require guzzlehttp/guzzle:^7.0 guzzlehttp/psr7:^2.0
```

You may choose to use any other implementations of the PSR interfaces though.

If you want to use the **Twilio** gateway you also need to install the Twilio SDK:

```
$ composer require twilio/sdk
```

If you want to use the **Vonage** gateway you also need to install the Vonage client:

```
$ composer require vonage/client-core
```

Usage
-----

[](#usage)

```
use AnSms\{
    SmsTransceiver,
    Message\Message,
    Message\PremiumMessage,
    Gateway\CellsyntGateway
};

$gateway = new CellsyntGateway('username', 'password');
$smsTransceiver = new SmsTransceiver($gateway);

// Send SMS
$message = Message::create('46700000000', 'Hello world!');
$smsTransceiver->sendMessage($message);

// Receive SMS
$receivedMessage = $smsTransceiver->receiveMessage($_GET);

// Receive SMS delivery report
$deliveryReport = $smsTransceiver->receiveDeliveryReport($_GET);

// Send Premium SMS
$premiumMessage = PremiumMessage::createFromIncomingMessage(
    'Thanks for your payment!',
    5,
    $receivedMessage
);
$smsTransceiver->sendMessage($premiumMessage);
```

Upgrading
---------

[](#upgrading)

Please see [UPGRADING](UPGRADING.md) for details.

Author
------

[](#author)

Andreas Nilsson ()

License
-------

[](#license)

This software is licensed under the MIT license - see the [LICENSE](LICENSE.md) file for details.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance82

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.2% 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 ~271 days

Recently: every ~385 days

Total

13

Last Release

81d ago

Major Versions

0.6 → 1.02023-03-02

1.2 → 2.02026-04-03

PHP version history (4 changes)0.1PHP &gt;=7.1

0.6PHP &gt;=8.0

1.0PHP &gt;=8.1

2.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![andreasnij](https://avatars.githubusercontent.com/u/1712334?v=4)](https://github.com/andreasnij "andreasnij (50 commits)")[![jongotlin](https://avatars.githubusercontent.com/u/165154?v=4)](https://github.com/jongotlin "jongotlin (1 commits)")[![viirre](https://avatars.githubusercontent.com/u/697468?v=4)](https://github.com/viirre "viirre (1 commits)")

---

Tags

46elkscellsyntnexmophpsmstwiliosmstwiliovonagenexmopremium smspsmscellsynt46elks

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jandreasn-an-sms/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

84735.1k](/packages/flow-php-flow)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)

PHPackages © 2026

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