PHPackages                             interserver/mailbaby-client-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. [API Development](/categories/api)
4. /
5. interserver/mailbaby-client-php

ActiveLibrary[API Development](/categories/api)

interserver/mailbaby-client-php
===============================

\*\*Send emails fast and with confidence through our easy to use \[REST\](https://en.wikipedia.org/wiki/Representational\_state\_transfer) API interface.\*\* # Overview This is the API interface to the \[Mail Baby\](https://mail.baby/) Mail services provided by \[InterServer\](https://www.interserver.net). To use this service you must have an account with us at \[my.interserver.net\](https://my.interserver.net). # Mail Orders Every sending account in MailBaby is backed by a \*\*Mail Order\*\* — a provisioned sending credential with a numeric `id` and a corresponding SMTP username (`mb&lt;id&gt;`). Most calls accept an optional `id` parameter; when omitted the API automatically selects the first active order on your account. Use `GET /mail` to list all orders, and `GET /mail/{id}` to inspect a single order including its current SMTP password. # Sending Email Three sending methods are available depending on your use-case: | Endpoint | Best for | |----------|----------| | `POST /mail/send` | Simple single-recipient messages | | `POST /mail/advsend` | Multiple recipients, CC/BCC, attachments, named contacts | | `POST /mail/rawsend` | Pre-built RFC 822 messages (e.g. DKIM-signed payloads) | After a successful send each endpoint returns a `GenericResponse` whose `text` field contains the \*\*transaction ID\*\* assigned by the relay. This ID can later be matched against entries in `GET /mail/log` via the `mailid` query parameter. # Filtering &amp; Logs `GET /mail/log` provides paginated access to every message accepted by the relay for your account. Combine any of the query parameters to narrow results — e.g. `from`, `to`, `subject`, `messageId`, `origin`, `mx`, `startDate`/`endDate`, and `delivered`. # Blocking Two independent mechanisms exist for suppressing unwanted email: - \*\*Block lists\*\* (`GET /mail/blocks`, `POST /mail/blocks/delete`) — addresses flagged by the system spam filters (LOCAL\_BL\_RCPT / MBTRAP rules in rspamd, and suspicious subjects). - \*\*Deny rules\*\* (`GET /mail/rules`, `POST /mail/rules`, `DELETE /mail/rules/{ruleId}`) — custom rules you configure to reject specific senders, domains, destination addresses, or subject-line prefixes before a message is even attempted. # Authentication In order to use most of the API calls you must pass credentials from the \[my.interserver.net\](https://my.interserver.net/) site. We support several different authentication methods but the preferred method is to use the \*\*API Key\*\* which you can get from the \[Account Security\](https://my.interserver.net/account\_security) page. Pass your key in the `X-API-KEY` HTTP request header for every protected call.

1.0.0(5y ago)0206↓75%1proprietaryPHPPHP &gt;=5.5

Since May 3Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/interserver/mailbaby-client-php)[ Packagist](https://packagist.org/packages/interserver/mailbaby-client-php)[ Docs](http://swagger.io)[ RSS](/packages/interserver-mailbaby-client-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

MailBaby
========

[](#mailbaby)

**Send emails fast and with confidence through our easy to use [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API interface.**

Overview
========

[](#overview)

This is the API interface to the [Mail Baby](https://mail.baby/) Mail services provided by [InterServer](https://www.interserver.net). To use this service you must have an account with us at [my.interserver.net](https://my.interserver.net).

Mail Orders
===========

[](#mail-orders)

Every sending account in MailBaby is backed by a **Mail Order** — a provisioned sending credential with a numeric `id` and a corresponding SMTP username (`mb`). Most calls accept an optional `id` parameter; when omitted the API automatically selects the first active order on your account. Use `GET /mail` to list all orders, and `GET /mail/{id}` to inspect a single order including its current SMTP password.

Sending Email
=============

[](#sending-email)

Three sending methods are available depending on your use-case: | Endpoint | Best for | |----------|----------| | `POST /mail/send` | Simple single-recipient messages | | `POST /mail/advsend` | Multiple recipients, CC/BCC, attachments, named contacts | | `POST /mail/rawsend` | Pre-built RFC 822 messages (e.g. DKIM-signed payloads) |

After a successful send each endpoint returns a `GenericResponse` whose `text` field contains the **transaction ID** assigned by the relay. This ID can later be matched against entries in `GET /mail/log` via the `mailid` query parameter.

Filtering &amp; Logs
====================

[](#filtering--logs)

`GET /mail/log` provides paginated access to every message accepted by the relay for your account. Combine any of the query parameters to narrow results — e.g. `from`, `to`, `subject`, `messageId`, `origin`, `mx`, `startDate`/`endDate`, and `delivered`.

Blocking
========

[](#blocking)

Two independent mechanisms exist for suppressing unwanted email:

- **Block lists** (`GET /mail/blocks`, `POST /mail/blocks/delete`) — addresses flagged by the system spam filters (LOCAL\_BL\_RCPT / MBTRAP rules in rspamd, and suspicious subjects).
- **Deny rules** (`GET /mail/rules`, `POST /mail/rules`, `DELETE /mail/rules/{ruleId}`) — custom rules you configure to reject specific senders, domains, destination addresses, or subject-line prefixes before a message is even attempted.

Authentication
==============

[](#authentication)

In order to use most of the API calls you must pass credentials from the [my.interserver.net](https://my.interserver.net/) site. We support several different authentication methods but the preferred method is to use the **API Key** which you can get from the [Account Security](https://my.interserver.net/account_security) page. Pass your key in the `X-API-KEY` HTTP request header for every protected call.

For more information, please visit .

Installation &amp; Usage
------------------------

[](#installation--usage)

### Requirements

[](#requirements)

PHP 8.1 and later.

### Composer

[](#composer)

To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:

```
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/interserver/mailbaby-client-php.git"
    }
  ],
  "require": {
    "interserver/mailbaby-client-php": "*@dev"
  }
}
```

Then run `composer install`

### Manual Installation

[](#manual-installation)

Download the files and include `autoload.php`:

```
