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

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

sendkit/sendkit-php
===================

PHP SDK for the SendKit email API

1.1.4(1mo ago)1516↓24.4%1MITPHPPHP ^8.3CI passing

Since Feb 28Pushed 1mo agoCompare

[ Source](https://github.com/sendkitdev/sendkit-php)[ Packagist](https://packagist.org/packages/sendkit/sendkit-php)[ RSS](/packages/sendkit-sendkit-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (1)

SendKit PHP SDK
===============

[](#sendkit-php-sdk)

Official PHP SDK for the [SendKit](https://sendkit.dev) email API.

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

[](#installation)

```
composer require sendkit/sendkit-php
```

Usage
-----

[](#usage)

### Create a Client

[](#create-a-client)

```
use SendKit\SendKit;

$client = SendKit::client('your-api-key');
```

### Send an Email

[](#send-an-email)

```
$response = $client->emails()->send([
    'from' => 'you@example.com',
    'to' => 'recipient@example.com',
    'subject' => 'Hello from SendKit',
    'html' => 'Welcome!',
]);

echo $response['id']; // Email ID
```

### Send a MIME Email

[](#send-a-mime-email)

```
$response = $client->emails()->sendMime(
    envelopeFrom: 'you@example.com',
    envelopeTo: 'recipient@example.com',
    rawMessage: $mimeString,
);

echo $response['id'];
```

### Contacts

[](#contacts)

#### Create or Update a Contact (Upsert)

[](#create-or-update-a-contact-upsert)

```
$contact = $client->contacts()->create([
    'email' => 'john@example.com',
    'first_name' => 'John',
    'last_name' => 'Doe',
    'unsubscribed' => false,
    'list_ids' => ['list-uuid-1', 'list-uuid-2'],
    'properties' => ['COMPANY' => 'Acme'],
]);

echo $contact['id'];
```

If a contact with that email already exists, it will be updated instead.

#### List Contacts

[](#list-contacts)

```
$contacts = $client->contacts()->list();
$contacts = $client->contacts()->list(['page' => 2]);

$contacts['data'];           // array of contacts
$contacts['meta']['total'];  // total count
```

#### Get a Contact

[](#get-a-contact)

```
$contact = $client->contacts()->get('contact-uuid');
```

#### Update a Contact

[](#update-a-contact)

```
$contact = $client->contacts()->update('contact-uuid', [
    'first_name' => 'Johnny',
    'unsubscribed' => true,
]);
```

#### Delete a Contact

[](#delete-a-contact)

```
$client->contacts()->delete('contact-uuid');
```

#### Add a Contact to Lists

[](#add-a-contact-to-lists)

```
$contact = $client->contacts()->addToLists('contact-uuid', ['list-uuid-1', 'list-uuid-2']);
```

#### List a Contact's Lists

[](#list-a-contacts-lists)

```
$lists = $client->contacts()->listLists('contact-uuid');
$lists = $client->contacts()->listLists('contact-uuid', ['page' => 2]);
```

#### Remove a Contact from a List

[](#remove-a-contact-from-a-list)

```
$client->contacts()->removeFromList('contact-uuid', 'list-uuid');
```

### Contact Properties

[](#contact-properties)

#### Create a Property

[](#create-a-property)

```
$property = $client->contactProperties()->create([
    'key' => 'company',
    'type' => 'string',           // "string", "number", or "date"
    'fallback_value' => 'N/A',    // optional
]);

echo $property['id'];
```

#### List Properties

[](#list-properties)

```
$properties = $client->contactProperties()->list();
$properties = $client->contactProperties()->list(['page' => 2]);
```

#### Update a Property

[](#update-a-property)

```
$property = $client->contactProperties()->update('property-uuid', [
    'key' => 'organization',
    'fallback_value' => 'Unknown',
]);
```

#### Delete a Property

[](#delete-a-property)

```
$client->contactProperties()->delete('property-uuid');
```

> **Note:** A `SendKitException` with status 409 is thrown if the property is used in segment filters.

### Validate an Email

[](#validate-an-email)

```
$result = $client->validateEmail('recipient@example.com');

$result['is_valid'];       // "HIGH" or "LOW"
$result['should_block'];   // true if the email should be blocked
$result['block_reason'];   // reason for blocking, or null
$result['evaluations'];    // detailed evaluation results
```

The `evaluations` array contains:

- `has_valid_syntax` — whether the email has valid syntax
- `has_valid_dns` — whether the domain has valid DNS records
- `mailbox_exists` — whether the mailbox exists
- `is_role_address` — whether it's a role address (e.g. info@, admin@)
- `is_disposable` — whether it's a disposable email
- `is_random_input` — whether it appears to be random input

> **Note:** Each validation costs credits. A `SendKitException` with status 402 is thrown when credits are insufficient.

### Error Handling

[](#error-handling)

```
use SendKit\Exceptions\SendKitException;

try {
    $client->emails()->send([...]);
} catch (SendKitException $e) {
    echo $e->getMessage(); // Error message
    echo $e->status;       // HTTP status code
}
```

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance96

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Total

11

Last Release

50d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.4PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![paulocastellano](https://avatars.githubusercontent.com/u/265964?v=4)](https://github.com/paulocastellano "paulocastellano (19 commits)")

---

Tags

apisdkemailsendkit

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[hafael/azure-mailer-driver

Supercharge your Laravel or Symfony app with Microsoft Azure Communication Services (ACS)! Effortlessly add email, chat, voice, video, and telephony-over-IP for next-level communication. 🚀

14109.2k](/packages/hafael-azure-mailer-driver)

PHPackages © 2026

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