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

Abandoned → [andreasnij/an-sms](/?search=andreasnij%2Fan-sms)Library

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

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

1.2(1y ago)921.8k↓100%3[1 issues](https://github.com/andreasnij/an-sms/issues)MITPHPPHP &gt;=8.1

Since May 7Pushed 1y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (11)Versions (13)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

44

—

FairBetter than 91% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

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

Recently: every ~524 days

Total

12

Last Release

606d ago

Major Versions

0.6 → 1.02023-03-02

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

0.6PHP &gt;=8.0

1.0PHP &gt;=8.1

### 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 (49 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

[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)[theodo-group/llphant

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

1.5k311.5k5](/packages/theodo-group-llphant)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[growthbook/growthbook

PHP SDK for GrowthBook, the feature flagging and A/B testing platform

202.9M3](/packages/growthbook-growthbook)

PHPackages © 2026

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