PHP HTTP client for MailSlurp API. Generated with swagger-codegen.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Documentation for MailSlurp's public REST API. ### About MailSlurp is a SAAS API for sending and receiving emails from ephemeral email inboxes. These inboxes can be created on the fly and each has a unique email address. ### Why MailSlurp was built for testing software or processes that interact with email in some way. For more information see the homepage. ### Links - Get API Key - API Documentation - Official SDK Libraries - Support / Issues - Swagger JSON ### Use You can call the MailSlurp API from any HTTP client in any language. Or you use one of the official generated SDK Libraries. - Official Typescript SDK - Official Python SDK - Official C# SDK - Official Java SDK - Official Swift SDK - Official Golang SDK - Official Javascript SDK - Official PHP SDK - Official Ruby SDK You can also compile your own library with SwaggerCodegen and the Swagger Spec. Lastly, there is an interactive GUI available at for testing requests. ### Auth An API Key must be passed as a header in all requests. To get an API Key sign up and log in to the MailSlurp Dashboard web app. ### Terms - Inbox - A unique email address - Unlimited in number - Can send and receive emails - Email - Belongs to an inbox - Contains summary and body - Raw content stored on S3 ### Issues If you encounter issues please contact the developers or open a ticket in GitHub.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 0.0.1-alpha
  • Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit


PHP 5.5 and later

Installation & Usage


To install the bindings via Composer, add the following to composer.json:

  "repositories": [
      "type": "git",
      "url": ""
  "require": {
    "mailslurp/swagger-sdk-php": "*@dev"

Then run composer install

Manual Installation

Download the files and include autoload.php:



To run the unit tests:

composer install

Getting Started

Please follow the installation procedure and then run the following:

require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: API_KEY
$config = MailSlurpSDK\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpSDK\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

$apiInstance = new MailSlurpSDK\Api\EmailControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
$id = "id_example"; // string | id

try {
} catch (Exception $e) {
    echo 'Exception when calling EmailControllerApi->deleteMessageUsingDELETE: ', $e->getMessage(), PHP_EOL;


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
EmailControllerApi deleteMessageUsingDELETE DELETE /emails/{id} Delete Email
EmailControllerApi getMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
EmailControllerApi getMessageUsingGET GET /emails/{id} Get Email Content
InboxControllerApi createInboxUsingPOST POST /inboxes Create Inbox
InboxControllerApi deleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
InboxControllerApi getInboxUsingGET GET /inboxes/{id} Get Inbox
InboxControllerApi getInboxesUsingGET GET /inboxes List Inboxes
InboxControllerApi getMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
InboxControllerApi sendMessageUsingPOST POST /inboxes/{id} Send Email
ManageEntitiesApi deleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
ManageEntitiesApi deleteMessageUsingDELETE DELETE /emails/{id} Delete Email
ManageEntitiesApi getInboxUsingGET GET /inboxes/{id} Get Inbox
ManageEntitiesApi getInboxesUsingGET GET /inboxes List Inboxes
ReceiveEmailsApi createInboxUsingPOST POST /inboxes Create Inbox
ReceiveEmailsApi getMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
ReceiveEmailsApi getMessageUsingGET GET /emails/{id} Get Email Content
ReceiveEmailsApi getMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
SendEmailsApi createInboxUsingPOST POST /inboxes Create Inbox
SendEmailsApi sendMessageUsingPOST POST /inboxes/{id} Send Email

Documentation For Models

Documentation For Authorization


  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header