# MailSlurp\CommonActionsControllerApi

All URIs are relative to https://api.mailslurp.com

Method HTTP request Description
createNewEmailAddress POST /newEmailAddress Create new random inbox
emptyInbox DELETE /emptyInbox Delete all emails in an inbox
sendEmailSimple POST /sendEmail Send an email from a random email address

# createNewEmailAddress

\MailSlurp\Models\Inbox createNewEmailAddress()

Create new random inbox

Returns an Inbox with an id and an emailAddress

# Example

<?php
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\CommonActionsControllerApi(
    // 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(),
    $config
);
try {
    $result = $apiInstance->createNewEmailAddress();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->createNewEmailAddress: ', $e->getMessage(), PHP_EOL;
}
?>

# Parameters

This endpoint does not need any parameter.

# Return type

\MailSlurp\Models\Inbox

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# emptyInbox

emptyInbox($inbox_id)

Delete all emails in an inbox

Deletes all emails

# Example

<?php
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\CommonActionsControllerApi(
    // 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(),
    $config
);
$inbox_id = 'inbox_id_example'; // string | inboxId
try {
    $apiInstance->emptyInbox($inbox_id);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->emptyInbox: ', $e->getMessage(), PHP_EOL;
}
?>

# Parameters

Name Type Description Notes
inbox_id string inboxId

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# sendEmailSimple

sendEmailSimple($send_email_options)

Send an email from a random email address

To specify an email address first create an inbox and use that with the other send email methods

# Example

<?php
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\CommonActionsControllerApi(
    // 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(),
    $config
);
$send_email_options = new \MailSlurp\Models\SendEmailOptions(); // \MailSlurp\Models\SendEmailOptions | sendEmailOptions
try {
    $apiInstance->sendEmailSimple($send_email_options);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->sendEmailSimple: ', $e->getMessage(), PHP_EOL;
}
?>

# Parameters

Name Type Description Notes
send_email_options \MailSlurp\Models\SendEmailOptions sendEmailOptions

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]