All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
createRandomInboxUsingPOST | POST /inboxes | Create an inbox |
deleteInboxUsingDELETE | DELETE /inboxes/{uuid} | Delete an inbox |
getEmailsForInboxUsingGET | GET /inboxes/{uuid} | Fetch emails for a given inbox |
getListOfInboxesUsingGET | GET /inboxes | List your inboxes |
sendEmailFromUserUsingPOST | POST /inboxes/{uuid} | Send an email |
\MailSlurp\Swagger\Model\ResponseInboxDto_ createRandomInboxUsingPOST($apiKey)
Create an inbox
Create a new random inbox and return the id and email address for it. Send emails to this address and they will be stored for this inbox.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new MailSlurp\Swagger\Api\InboxControllerApi(
// 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()
);
$apiKey = "test"; // string | Your API Key. Sign up and find it in your dashboard.
try {
$result = $apiInstance->createRandomInboxUsingPOST($apiKey);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InboxControllerApi->createRandomInboxUsingPOST: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
apiKey | string | Your API Key. Sign up and find it in your dashboard. | [default to test] |
\MailSlurp\Swagger\Model\ResponseInboxDto_
No authorization required
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailSlurp\Swagger\Model\Response deleteInboxUsingDELETE($apiKey, $uuid)
Delete an inbox
Delete an inbox and all the emails associated with it.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new MailSlurp\Swagger\Api\InboxControllerApi(
// 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()
);
$apiKey = "test"; // string | Your API Key. Sign up and find it in your dashboard.
$uuid = "uuid_example"; // string | The inbox's id.
try {
$result = $apiInstance->deleteInboxUsingDELETE($apiKey, $uuid);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InboxControllerApi->deleteInboxUsingDELETE: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
apiKey | string | Your API Key. Sign up and find it in your dashboard. | [default to test] |
uuid | string | The inbox's id. |
\MailSlurp\Swagger\Model\Response
No authorization required
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailSlurp\Swagger\Model\ResponseListEmailDto_ getEmailsForInboxUsingGET($apiKey, $uuid, $minCount, $maxWait, $since)
Fetch emails for a given inbox
Return a list of emails stored in a given inbox. Each email contains various properties including the email body (in eml format), subject, and sender. The since
parameter is a ISO8601 LocalDateTime that will filter for emails received on or after the given DateTime. Note that because an inbox may take 5 to 10 seconds to receive an email, you can use the waitFor
parameter to hold a request open until the desired number of emails is present. If this number is not met after 60 seconds, an error will be returned.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new MailSlurp\Swagger\Api\InboxControllerApi(
// 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()
);
$apiKey = "test"; // string | Your API Key. Sign up and find it in your dashboard.
$uuid = "uuid_example"; // string | The inbox's id.
$minCount = 56; // int | Wait a maximum of 60 seconds for atleast this many emails in an inbox before returning a result.
$maxWait = 789; // int | Maximum seconds API should spend retrying your inbox until the minCount is satisfied
$since = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter for emails received on or after this ISO8601 LocalDateTime.
try {
$result = $apiInstance->getEmailsForInboxUsingGET($apiKey, $uuid, $minCount, $maxWait, $since);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InboxControllerApi->getEmailsForInboxUsingGET: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
apiKey | string | Your API Key. Sign up and find it in your dashboard. | [default to test] |
uuid | string | The inbox's id. | |
minCount | int | Wait a maximum of 60 seconds for atleast this many emails in an inbox before returning a result. | [optional] |
maxWait | int | Maximum seconds API should spend retrying your inbox until the minCount is satisfied | [optional] |
since | \DateTime | Filter for emails received on or after this ISO8601 LocalDateTime. | [optional] |
\MailSlurp\Swagger\Model\ResponseListEmailDto_
No authorization required
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailSlurp\Swagger\Model\ResponseListInboxDto_ getListOfInboxesUsingGET($apiKey)
List your inboxes
Return a list of your inboxes. Each inbox has a uuid and an email address. Emails sent to the email address are stored in the inbox and can be fetched via /inboxes/{uuid}
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new MailSlurp\Swagger\Api\InboxControllerApi(
// 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()
);
$apiKey = "test"; // string | Your API Key. Sign up and find it in your dashboard.
try {
$result = $apiInstance->getListOfInboxesUsingGET($apiKey);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InboxControllerApi->getListOfInboxesUsingGET: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
apiKey | string | Your API Key. Sign up and find it in your dashboard. | [default to test] |
\MailSlurp\Swagger\Model\ResponseListInboxDto_
No authorization required
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailSlurp\Swagger\Model\Response sendEmailFromUserUsingPOST($apiKey, $uuid, $sendEmailDto)
Send an email
Send an email from the given inbox's email address. Useful if you need to test a user contacting you, for instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new MailSlurp\Swagger\Api\InboxControllerApi(
// 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()
);
$apiKey = "test"; // string | Your API Key. Sign up and find it in your dashboard.
$uuid = "uuid_example"; // string | The inbox's id.
$sendEmailDto = new \MailSlurp\Swagger\Model\SendEmailDto(); // \MailSlurp\Swagger\Model\SendEmailDto | The email to send.
try {
$result = $apiInstance->sendEmailFromUserUsingPOST($apiKey, $uuid, $sendEmailDto);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InboxControllerApi->sendEmailFromUserUsingPOST: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
apiKey | string | Your API Key. Sign up and find it in your dashboard. | [default to test] |
uuid | string | The inbox's id. | |
sendEmailDto | \MailSlurp\Swagger\Model\SendEmailDto | The email to send. |
\MailSlurp\Swagger\Model\Response
No authorization required
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]