---
title: "PHP SDK"
description: "The official PHP client for the OpenEmail API. One Composer package with no runtime dependencies beyond cURL, and one method for every endpoint."
url: "https://openemail.uk/docs/php"
area: "PHP"
category: "Getting started"
---

# PHP SDK

The official PHP client for the OpenEmail API. One Composer package with no runtime dependencies beyond cURL, and one method for every endpoint.

## What it is

One package over the whole API (sending, templates, tracking, threads, drafts, labels, contacts, audiences, sign-up forms, broadcasts, domains, rules, webhooks, calendar, settings, roles, members, suppressions, files and disposable inboxes) with a method for every method of the TypeScript SDK under the same name, an exception class for every kind of refusal, retries that cannot duplicate a send, and a webhook signature verifier. It needs PHP 8.2 or later with the curl and json extensions, and nothing else, and it works with any PSR-18 HTTP client when you would rather use your own.

**Install**

_Composer_

```bash
composer require openemail/sdk
```

**send_email.php**

```
<?php

use OpenEmail\OpenEmail;

require __DIR__ . '/vendor/autoload.php';

$client = new OpenEmail();

$client->emails->send([
    'from' => 'Acme Billing <billing@acme.com>',
    'to' => 'ada@example.com',
    'subject' => 'Your September invoice',
    'html' => '<p>Invoice attached.</p>',
]);
```

## Where to go

- [Install](https://openemail.uk/docs/php/install.md): Add the package and send your first message.
- [Configuration](https://openemail.uk/docs/php/configuration.md): Every option, and what it refuses.
- [Send an email](https://openemail.uk/docs/php/emails/send.md): Every field on a message.
- [Threads](https://openemail.uk/docs/php/threads.md): Read, organise, snooze, attachments.
- [Webhooks](https://openemail.uk/docs/php/webhooks/endpoints.md): Register an endpoint and verify it.
- [Errors](https://openemail.uk/docs/php/errors.md): What is thrown, and how to catch it.
- [Retries](https://openemail.uk/docs/php/retries.md): Why a retried send cannot duplicate.
- [Pagination](https://openemail.uk/docs/php/pagination.md): One page, every page, or one item at a time.
- [Laravel and Symfony](https://openemail.uk/docs/php/frameworks.md): Configuration, queues, webhooks and tests.
- [HTTP clients](https://openemail.uk/docs/php/http-clients.md): cURL by default, or any PSR-18 client.
- [Every method](https://openemail.uk/docs/php/reference/methods.md): The complete list, one row each.

## It wraps the same API as every other client

Everything here is the surface the API reference documents and the TypeScript SDK wraps, so read the API reference for what an endpoint does and this for how to call it from PHP. Every TypeScript method has a PHP twin, and the package’s parity check runs both with the same arguments and fails unless they send byte for byte the same request.

- [API reference](https://openemail.uk/docs/api/overview.md): What each endpoint does, and how it fails.
