dev-master 2019-08-08 23:09 UTC


For extensive guides and examples see full documentation. Create an account in the MailSlurp Dashboard to view your API Key. For all bugs, feature requests, or help please see support.

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\CommonOperationsApi(
    // 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(),

try {
    $result = $apiInstance->createNewEmailAddressUsingPOST();
} catch (Exception $e) {
    echo 'Exception when calling CommonOperationsApi->createNewEmailAddressUsingPOST: ', $e->getMessage(), PHP_EOL;


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
CommonOperationsApi createNewEmailAddressUsingPOST POST /newEmailAddress Create new email address
CommonOperationsApi fetchLatestEmailUsingGET GET /fetchLatestEmail Fetch inbox's latest email or if empty wait for email to arrive
CommonOperationsApi sendEmailSimpleUsingPOST POST /sendEmail Send an email from a random email address
ExtraOperationsApi bulkCreateInboxesUsingPOST POST /bulk/inboxes Bulk create Inboxes (email addresses)
ExtraOperationsApi bulkDeleteInboxesUsingDELETE DELETE /bulk/inboxes Bulk Delete Inboxes
ExtraOperationsApi bulkSendEmailsUsingPOST POST /bulk/send Bulk Send Emails
ExtraOperationsApi createInboxUsingPOST POST /inboxes Create an Inbox (email address)
ExtraOperationsApi deleteEmailUsingDELETE DELETE /emails/{emailId} Delete Email
ExtraOperationsApi deleteInboxUsingDELETE DELETE /inboxes/{inboxId} Delete Inbox
ExtraOperationsApi getEmailUsingGET GET /emails/{emailId} Get Email Content
ExtraOperationsApi getEmailsUsingGET GET /inboxes/{inboxId}/emails List an Inbox's Emails
ExtraOperationsApi getInboxUsingGET GET /inboxes/{inboxId} Get Inbox
ExtraOperationsApi getInboxesUsingGET GET /inboxes List Inboxes
ExtraOperationsApi getRawEmailUsingGET GET /emails/{emailId}/raw Get Raw Email Content
ExtraOperationsApi sendEmailUsingPOST POST /inboxes/{inboxId} Send Email

Documentation For Models

Documentation For Authorization


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