# mailslurp.Api.CommonActionsControllerApi

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

Method HTTP request Description
CreateNewEmailAddress POST /createInbox Create new random inbox
CreateNewEmailAddress1 POST /newEmailAddress Create new random inbox
EmptyInbox DELETE /emptyInbox Delete all emails in an inbox
SendEmailSimple POST /sendEmail Send an email

# CreateNewEmailAddress

Inbox CreateNewEmailAddress ()

Create new random inbox

Returns an Inbox with an id and an emailAddress

# Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
    public class CreateNewEmailAddressExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mailslurp.com";
            // Configure API key authorization: API_KEY
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");
            var apiInstance = new CommonActionsControllerApi(config);
            try
            {
                // Create new random inbox
                Inbox result = apiInstance.CreateNewEmailAddress();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CommonActionsControllerApi.CreateNewEmailAddress: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

# Parameters

This endpoint does not need any parameter.

# Return type

Inbox

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

# CreateNewEmailAddress1

Inbox CreateNewEmailAddress1 ()

Create new random inbox

Returns an Inbox with an id and an emailAddress

# Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
    public class CreateNewEmailAddress1Example
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mailslurp.com";
            // Configure API key authorization: API_KEY
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");
            var apiInstance = new CommonActionsControllerApi(config);
            try
            {
                // Create new random inbox
                Inbox result = apiInstance.CreateNewEmailAddress1();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CommonActionsControllerApi.CreateNewEmailAddress1: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

# Parameters

This endpoint does not need any parameter.

# Return type

Inbox

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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

# EmptyInbox

void EmptyInbox (Guid inboxId)

Delete all emails in an inbox

Deletes all emails

# Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
    public class EmptyInboxExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mailslurp.com";
            // Configure API key authorization: API_KEY
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");
            var apiInstance = new CommonActionsControllerApi(config);
            var inboxId = new Guid(); // Guid | inboxId
            try
            {
                // Delete all emails in an inbox
                apiInstance.EmptyInbox(inboxId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CommonActionsControllerApi.EmptyInbox: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

# Parameters

Name Type Description Notes
inboxId Guid inboxId

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
204 No Content -
401 Unauthorized -
403 Forbidden -

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

# SendEmailSimple

void SendEmailSimple (SimpleSendEmailOptions emailOptions)

Send an email

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

# Example

using System.Collections.Generic;
using System.Diagnostics;
using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;
namespace Example
{
    public class SendEmailSimpleExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mailslurp.com";
            // Configure API key authorization: API_KEY
            config.AddApiKey("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("x-api-key", "Bearer");
            var apiInstance = new CommonActionsControllerApi(config);
            var emailOptions = new SimpleSendEmailOptions(); // SimpleSendEmailOptions | emailOptions
            try
            {
                // Send an email
                apiInstance.SendEmailSimple(emailOptions);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CommonActionsControllerApi.SendEmailSimple: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

# Parameters

Name Type Description Notes
emailOptions SimpleSendEmailOptions emailOptions

# Return type

void (empty response body)

# Authorization

API_KEY

# HTTP request headers

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

# HTTP response details

Status code Description Response headers
201 Created -
401 Unauthorized -
403 Forbidden -
404 Not Found -

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