For documentation see [developer guide]( [Create an account]( in the MailSlurp Dashboard to [view your API Key](https://app). For all bugs, feature requests, or help please [see support](

5.2.0 2019-09-29 18:56 UTC

This package is not auto-updated.

Last update: 2020-02-12 14:19:31 UTC


Available on Packagist as mailslurp-client-php For documentation see developer guide. 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 OpenAPI Generator project:

  • API version: 0.0.1-alpha
  • Package version: 5.2.0
  • Build package: org.openapitools.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": "vcs",
      "url": ""
  "require": {
    "mailslurp/mailslurp-client-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 = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

$apiInstance = new MailSlurp\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->createNewEmailAddress();
} catch (Exception $e) {
    echo 'Exception when calling CommonOperationsApi->createNewEmailAddress: ', $e->getMessage(), PHP_EOL;


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
CommonOperationsApi createNewEmailAddress POST /newEmailAddress Create new email address
CommonOperationsApi deleteEmail DELETE /deleteEmail Delete an email
CommonOperationsApi deleteEmailAddress DELETE /deleteEmailAddress Delete email address and its emails
CommonOperationsApi emptyInbox DELETE /emptyInbox Delete all emails in an inbox
CommonOperationsApi sendEmailSimple POST /sendEmail Send an email from a random email address
CommonOperationsApi waitForEmailCount GET /waitForEmailCount Wait for and return count number of emails
CommonOperationsApi waitForLatestEmail GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for email to arrive
CommonOperationsApi waitForMatchingEmail POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
CommonOperationsApi waitForNthEmail GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
ExtraOperationsApi bulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
ExtraOperationsApi bulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
ExtraOperationsApi bulkSendEmails POST /bulk/send Bulk Send Emails
ExtraOperationsApi createDomain POST /domains Create Domain
ExtraOperationsApi createInbox POST /inboxes Create an Inbox (email address)
ExtraOperationsApi createWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
ExtraOperationsApi deleteDomain DELETE /domains/{id} Delete a domain
ExtraOperationsApi deleteEmail1 DELETE /emails/{emailId} Delete Email
ExtraOperationsApi deleteInbox DELETE /inboxes/{inboxId} Delete Inbox / Email Address
ExtraOperationsApi deleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a WebHook for an Inbox
ExtraOperationsApi downloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment
ExtraOperationsApi forwardEmail POST /emails/{emailId}/forward Forward Email
ExtraOperationsApi getDomain GET /domains/{id} Get a domain
ExtraOperationsApi getDomains GET /domains Get domains
ExtraOperationsApi getEmail GET /emails/{emailId} Get Email Content
ExtraOperationsApi getEmails GET /inboxes/{inboxId}/emails List Emails in an Inbox / EmailAddress
ExtraOperationsApi getEmailsPaginated GET /emails Get all emails
ExtraOperationsApi getInbox GET /inboxes/{inboxId} Get Inbox / EmailAddress
ExtraOperationsApi getInboxes GET /inboxes List Inboxes / Email Addresses
ExtraOperationsApi getRawEmailContents GET /emails/{emailId}/raw Get Raw Email Content
ExtraOperationsApi getWebhooks GET /inboxes/{inboxId}/webhooks Get all WebHooks for an Inbox
ExtraOperationsApi sendEmail POST /inboxes/{inboxId} Send Email
ExtraOperationsApi uploadAttachment POST /attachments Upload an attachment for sending
ExtraOperationsApi uploadMultipartForm POST /attachments/multipart Upload an attachment for sending using Multipart Form

Documentation For Models

Documentation For Authorization


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