PHPackages                             ocolin/open-srs-mail - 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. [API Development](/categories/api)
4. /
5. ocolin/open-srs-mail

ActiveLibrary[API Development](/categories/api)

ocolin/open-srs-mail
====================

REST Client for OpenSRS Email API

1.5(6mo ago)04MITPHPPHP &gt;=8.3

Since Apr 28Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/ocolin/OpenSrsMail)[ Packagist](https://packagist.org/packages/ocolin/open-srs-mail)[ RSS](/packages/ocolin-open-srs-mail/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

OpenSRS Email REST Client
=========================

[](#opensrs-email-rest-client)

Description
-----------

[](#description)

This is a small lightweight API client for the OpenSRS Email API. Once configured it allows you to only have to worry about the API method and data.

API Documents
-------------

[](#api-documents)

Settings
--------

[](#settings)

There are two ways to configure the client. One is to provide them in the constructor when instantiating an object, The other is by using environment variables in the program calling this library.

### Environment Variables

[](#environment-variables)

See .env.example

- OPENSRS\_MAIL\_SERVER - The URL of the OpenSRS API server
- OPENSRS\_MAIL\_USER - The username of your OpenSRS account
- OPENSRS\_MAIL\_PASS - The password of your OpenSRS account

Examples
--------

[](#examples)

### Creating Client with constructor arguments

[](#creating-client-with-constructor-arguments)

```
// Create client using API info
$client = new Ocolin\OpenSrsMail\Client(
    base_uri: 'https://admin.test.hostedemail.com/api/',
    user: 'myusername@example.com',
    pass: 'MyPassword'
);

// Setup payload to send to API
$payload = [
    'fetch_extra_info' => true,
    'generate_session_token' => false,
    'token' => 'lkjhfjhksdjhfds',
];

// Specify the method name of the API, and provide the payload
$output = $client->call( method: 'authenticate', payload: $payload )->body;
```

### Creating Client with Environment variables

[](#creating-client-with-environment-variables)

```
// Set up environment vaiebales somewhere
$_ENV['OPENSRS_MAIL_SERVER'] = 'https://admin.test.hostedemail.com/api/';
$_ENV['OPENSRS_MAIL_USER'] = 'myusername@example.com';
$_ENV['OPENSRS_MAIL_PASS'] = 'MyPassword';

// Create your API client
$client = new Ocolin\OpenSrsMail\Client();

// Create your payload to send to the API
$payload = [
    'fetch_extra_info' => true,
    'generate_session_token' => false,
    'token' => 'lkjhfjhksdjhfds',
 ];

// Make call to client specifying which method, and the payload to send
$output = $client->call( method: 'authenticate', payload: $payload )->body;
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance66

Regular maintenance activity

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Recently: every ~45 days

Total

6

Last Release

199d ago

### Community

Maintainers

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

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-open-srs-mail/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-open-srs-mail/health.svg)](https://phpackages.com/packages/ocolin-open-srs-mail)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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