MailSlurpCommonActionsControllerApi

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

MethodHTTP requestDescription
createNewEmailAddressPOST /createInboxCreate new random inbox
createNewEmailAddress1POST /newEmailAddressCreate new random inbox
emptyInboxDELETE /emptyInboxDelete all emails in an inbox
sendEmailSimplePOST /sendEmailSend an email

createNewEmailAddress

MailSlurpModelsInbox createNewEmailAddress($allow_team_access, $expires_at, $expires_in, $use_domain_pool)

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 = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$allow_team_access = True; // bool | allowTeamAccess
$expires_at = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | expiresAt
$expires_in = 56; // int | expiresIn
$use_domain_pool = True; // bool | useDomainPool

try {
    $result = $apiInstance->createNewEmailAddress($allow_team_access, $expires_at, $expires_in, $use_domain_pool);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->createNewEmailAddress: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
allow_team_accessboolallowTeamAccess[optional]
expires_atDateTimeexpiresAt[optional]
expires_inintexpiresIn[optional]
use_domain_poolbooluseDomainPool[optional]

Return type

MailSlurpModelsInbox

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 ]

createNewEmailAddress1

MailSlurpModelsInbox createNewEmailAddress1($allow_team_access, $expires_at, $expires_in, $use_domain_pool)

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 = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$allow_team_access = True; // bool | allowTeamAccess
$expires_at = new DateTime("2013-10-20T19:20:30+01:00"); // DateTime | expiresAt
$expires_in = 56; // int | expiresIn
$use_domain_pool = True; // bool | useDomainPool

try {
    $result = $apiInstance->createNewEmailAddress1($allow_team_access, $expires_at, $expires_in, $use_domain_pool);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->createNewEmailAddress1: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
allow_team_accessboolallowTeamAccess[optional]
expires_atDateTimeexpiresAt[optional]
expires_inintexpiresIn[optional]
use_domain_poolbooluseDomainPool[optional]

Return type

MailSlurpModelsInbox

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 ]

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 = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $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

NameTypeDescriptionNotes
inbox_idstringinboxId

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 ]

sendEmailSimple

sendEmailSimple($email_options)

Send an email

If no senderId or inboxId provided a random email address will be used to send from.

Example

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


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


$apiInstance = new MailSlurpApiCommonActionsControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$email_options = new MailSlurpModelsSimpleSendEmailOptions(); // MailSlurpModelsSimpleSendEmailOptions | emailOptions

try {
    $apiInstance->sendEmailSimple($email_options);
} catch (Exception $e) {
    echo 'Exception when calling CommonActionsControllerApi->sendEmailSimple: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
email_optionsMailSlurpModelsSimpleSendEmailOptionsemailOptions

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 ]