PHPackages                             ravisystems/ravimail-php - 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. ravisystems/ravimail-php

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

ravisystems/ravimail-php
========================

Official PHP SDK for the RaviMail REST API v1 (api.ravimail.com.br).

v1.0.0(2mo ago)00MITPHPPHP &gt;=8.1

Since May 20Pushed 2mo agoCompare

[ Source](https://github.com/ravisystems/ravimail-php)[ Packagist](https://packagist.org/packages/ravisystems/ravimail-php)[ Docs](https://docs.ravimail.com.br)[ RSS](/packages/ravisystems-ravimail-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

RaviMail PHP SDK
================

[](#ravimail-php-sdk)

[![Packagist Version](https://camo.githubusercontent.com/7db082f10950ae9642df5333ba9b00c402bb750ab8c048ba4598af8631b1f9b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261766973797374656d732f726176696d61696c2d7068703f636f6c6f723d346634366535)](https://packagist.org/packages/ravisystems/ravimail-php)[![Packagist Downloads](https://camo.githubusercontent.com/9fa7962be8a707a0b752112793f3b20ca8da7e50047a8aa25e4375c005ca1bf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261766973797374656d732f726176696d61696c2d7068703f636f6c6f723d313062393831)](https://packagist.org/packages/ravisystems/ravimail-php)[![PHP Version](https://camo.githubusercontent.com/f00e02645d6b6be9d540be57494e9e17fc926d2326465e0cbc51606bb51480ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7261766973797374656d732f726176696d61696c2d7068703f636f6c6f723d373737626234)](https://packagist.org/packages/ravisystems/ravimail-php)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

Official PHP client for the [RaviMail](https://ravimail.com.br) REST API v1. Zero framework dependencies — only `ext-curl` + `ext-json`.

> **Why this exists.** RaviMail is a Brazilian email infrastructure platform with 155 documented REST endpoints. This SDK gives you typed access to all of them, with idiomatic PHP 8.1+ ergonomics and clear exception hierarchy.

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

[](#installation)

```
composer require ravisystems/ravimail-php
```

**Requirements:** PHP 8.1+, `ext-curl`, `ext-json`.

Quickstart — Hello World
------------------------

[](#quickstart--hello-world)

```
use Ravimail\Client;

$rm = new Client('rvm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

// Send a transactional email
$resp = $rm->transactional->send([
    'to'      => 'recipient@example.com',
    'from'    => 'you@yourdomain.com',
    'subject' => 'Welcome to the show',
    'html'    => 'Glad you’re here',
]);

echo $resp['data']['message_id']; // msg_xxxxxxxxxxxx
```

That's it. The SDK takes care of auth, JSON encoding, error parsing, and timeouts.

Test mode (no billing, no real send)
------------------------------------

[](#test-mode-no-billing-no-real-send)

Any token prefixed with `rvm_test_*` enables sandbox mode automatically. You can develop end-to-end without spending credits.

```
$test = new Client('rvm_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$test->transactional->send([/* ... */]); // returns msg_sandbox_xxx, doesn't bill
```

Send to the [Mailbox Simulator](https://ravimail.com.br/docs#api-sandbox) for deterministic scenarios: `bounce@simulator.ravimail.com.br`, `complaint@...`, `opened@...`, etc.

Available resources
-------------------

[](#available-resources)

All 23 resources mirror the REST API exactly. Most are CRUD; a few have helpers.

ResourceWhat it covers`$rm->me`Token info + quotas`$rm->transactional``send`, `batch`, `list`, `get``$rm->contacts`CRUD + tags + suppress + bulk import`$rm->lists`CRUD`$rm->templates`CRUD + render + versioning`$rm->campaigns`CRUD + `start`/`pause`/`resume`/`cancel`/`duplicate``$rm->domains`Add, verify, upgrade-to-panel`$rm->files`Upload (attachments)`$rm->webhooks`Endpoints + deliveries + `rotateSecret` + signature verifier`$rm->suppression`Suppress / unsuppress`$rm->analytics`Summary / timeseries / by domain, IP, node, ISP, device, country / heatmap`$rm->events`List + SSE stream URL`$rm->verification`Email + batch (DNS + MX + disposable + role detection)`$rm->segments`Dynamic segments + compute`$rm->exports`Async CSV jobs`$rm->inboundRoutes`Inbound parsing → forward webhook`$rm->drips`Drip campaigns + steps + subscribe`$rm->subaccounts`Multi-tenant (agency mode)`$rm->reputation`Score per domain / IP / node + summary`$rm->customFields`Custom field schema CRUD`$rm->reports`Scheduled reports`$rm->account`Billing + balance`$rm->smtpRelay`SMTP credentials lifecycleSee [`examples/`](examples/) for runnable snippets covering the most common flows.

Idempotency keys
----------------

[](#idempotency-keys)

For any write operation you want to retry safely, pass an `Idempotency-Key`:

```
$rm->transactional->send($payload, idempotencyKey: 'order-1024-confirmation');
```

The API guarantees that the second call with the same key returns the original response, byte for byte, even days later.

Webhook signature verification (server-side)
--------------------------------------------

[](#webhook-signature-verification-server-side)

Webhooks are HMAC-signed with the per-endpoint `signing_secret` returned at creation time.

```
use Ravimail\Resources\Webhooks;

$ok = Webhooks::verifySignature(
    $_SERVER['HTTP_X_RAVIMAIL_SIGNATURE'],
    file_get_contents('php://input'),
    'whsec_your_endpoint_secret'
);
if (!$ok) { http_response_code(401); exit; }
```

Constant-time comparison via `hash_equals` internally — no timing leak.

Error handling
--------------

[](#error-handling)

All non-2xx responses throw. Catch the most specific exception first.

```
use Ravimail\Exception\{
    ApiException, AuthenticationException, ValidationException, RateLimitException
};

try {
    $rm->transactional->send([/* ... */]);
} catch (ValidationException $e) {
    // 422 — bad payload; $e->getMessage() has the field-level detail
} catch (RateLimitException $e) {
    // 429 — back off and retry
} catch (AuthenticationException $e) {
    // 401 — token invalid, revoked, or wrong environment
} catch (ApiException $e) {
    // any other 4xx/5xx
}
```

The base `ApiException` exposes `->getCode()` (HTTP status) and `->getMessage()`(server's `title — detail` if present).

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

[](#configuration)

```
$rm = new Client(
    token: 'rvm_live_...',
    baseUrl: 'https://api.ravimail.com.br',  // override for staging if you have one
    timeout: 30,                              // seconds
);
```

Links
-----

[](#links)

- 📚 [Full docs](https://ravimail.com.br/docs) — concept guides, cookbooks, troubleshooting
- 🔌 [API reference](https://ravimail.com.br/api) — 155 endpoints, all groups
- 📝 [Changelog](https://ravimail.com.br/docs/changelog) — releases history
- 💡 [Conceitos](https://ravimail.com.br/docs/conceitos) — warmup, bounces, DKIM/SPF/DMARC explained
- 🐛 [Issues](https://github.com/ravisystems/ravimail-php/issues) — bug reports &amp; feature requests
- 🤝 [Contributing](CONTRIBUTING.md)

License
-------

[](#license)

[MIT](LICENSE) © Ravi Systems LTDA

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance87

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

66d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/127795006?v=4)[Rodrigo Matos dos Santos](/maintainers/rodrigomatos87)[@rodrigomatos87](https://github.com/rodrigomatos87)

---

Top Contributors

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

---

Tags

emailmarketingsmtptransactionalravimail

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ravisystems-ravimail-php/health.svg)

```
[![Health](https://phpackages.com/badges/ravisystems-ravimail-php/health.svg)](https://phpackages.com/packages/ravisystems-ravimail-php)
```

###  Alternatives

[mageplaza/module-smtp

SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers

3116.2M9](/packages/mageplaza-module-smtp)[zytzagoo/smtp-validate-email

Perform email address verification via SMTP

451963.2k3](/packages/zytzagoo-smtp-validate-email)[sendgrid/smtpapi

Build SendGrid X-SMTPAPI headers in PHP.

686.6M2](/packages/sendgrid-smtpapi)[mailerlite/mailerlite-api-v2-php-sdk

MailerLite API v2 PHP SDK

781.8M16](/packages/mailerlite-mailerlite-api-v2-php-sdk)[mailersend/mailersend

MailerSend PHP SDK

831.2M9](/packages/mailersend-mailersend)[mailersend/laravel-driver

MailerSend Laravel Driver

91875.7k9](/packages/mailersend-laravel-driver)

PHPackages © 2026

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