# MailSlurp\EmailControllerApi

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

Method HTTP request Description
DeleteAllEmails Delete /emails Delete all emails
DeleteEmail Delete /emails/{emailId} Delete an email
DownloadAttachment Get /emails/{emailId}/attachments/{attachmentId} Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
DownloadAttachmentBase64 Get /emails/{emailId}/attachments/{attachmentId}/base64 Get email attachment as base64 encoded string (alternative to binary responses)
ForwardEmail Post /emails/{emailId}/forward Forward email
GetAttachmentMetaData Get /emails/{emailId}/attachments/{attachmentId}/metadata Get email attachment metadata
GetAttachments Get /emails/{emailId}/attachments Get all email attachment metadata
GetEmail Get /emails/{emailId} Get email content
GetEmailContentMatch Post /emails/{emailId}/contentMatch Get email content regex pattern match results. Runs regex against email body and returns match groups.
GetEmailHTML Get /emails/{emailId}/html Get email content as HTML
GetEmailsPaginated Get /emails Get all emails
GetRawEmailContents Get /emails/{emailId}/raw Get raw email string
GetRawEmailJson Get /emails/{emailId}/raw/json Get raw email in JSON
GetUnreadEmailCount Get /emails/unreadCount Get unread email count
ValidateEmail Post /emails/{emailId}/validate Validate email

# DeleteAllEmails

DeleteAllEmails(ctx, )

Delete all emails

Deletes all emails in your account. Be careful as emails cannot be recovered

# Required Parameters

This endpoint does not need any parameter.

# Return type

(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]

# DeleteEmail

DeleteEmail(ctx, emailId)

Delete an email

Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email to delete

# Return type

(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]

# DownloadAttachment

string DownloadAttachment(ctx, attachmentId, emailId, optional)

Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64 response endpoints.

Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attachmentId string ID of attachment
emailId string ID of email
optional *DownloadAttachmentOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a DownloadAttachmentOpts struct

Name Type Description Notes

apiKey | optional.String| Can pass apiKey in url for this request if you wish to download the file in a browser. Content type will be set to original content type of the attachment file. This is so that browsers can download the file correctly. |

# Return type

string

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

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

# DownloadAttachmentBase64

DownloadAttachmentDto DownloadAttachmentBase64(ctx, attachmentId, emailId)

Get email attachment as base64 encoded string (alternative to binary responses)

Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment method but allows some clients to get around issues with binary responses.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attachmentId string ID of attachment
emailId string ID of email

# Return type

DownloadAttachmentDto

# 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]

# ForwardEmail

ForwardEmail(ctx, emailId, forwardEmailOptions)

Forward email

Forward an existing email to new recipients.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email
forwardEmailOptions ForwardEmailOptions forwardEmailOptions

# Return type

(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]

# GetAttachmentMetaData

AttachmentMetaData GetAttachmentMetaData(ctx, attachmentId, emailId)

Get email attachment metadata

Returns the metadata such as name and content-type for a given attachment and email.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attachmentId string ID of attachment
emailId string ID of email

# Return type

AttachmentMetaData

# 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]

# GetAttachments

[]AttachmentMetaData GetAttachments(ctx, emailId)

Get all email attachment metadata

Returns an array of attachment metadata such as name and content-type for a given email if present.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email

# Return type

[]AttachmentMetaData

# 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]

# GetEmail

Email GetEmail(ctx, emailId, optional)

Get email content

Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string emailId
optional *GetEmailOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a GetEmailOpts struct

Name Type Description Notes

decode | optional.Bool| Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance `=D7`). This can be a pain for testing | [default to false]

# Return type

Email

# 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]

# GetEmailContentMatch

EmailContentMatchResult GetEmailContentMatch(ctx, emailId, contentMatchOptions)

Get email content regex pattern match results. Runs regex against email body and returns match groups.

Return the matches for a given Java style regex pattern. Do not include the typical / at start or end of regex in some languages. Given an example your code is: 12345 the pattern to extract match looks like code is: (\\d{6}). This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: ['code is: 123456', '123456'] See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email to match against
contentMatchOptions ContentMatchOptions contentMatchOptions

# Return type

EmailContentMatchResult

# Authorization

API_KEY

# HTTP request headers

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

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

# GetEmailHTML

string GetEmailHTML(ctx, emailId, optional)

Get email content as HTML

Retrieve email content as HTML response for viewing in browsers. Decodes quoted-printable entities and converts charset to UTF-8. Pass your API KEY as a request parameter when viewing in a browser: ?apiKey=xxx

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string emailId
optional *GetEmailHTMLOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a GetEmailHTMLOpts struct

Name Type Description Notes

decode | optional.Bool| decode | [default to false]

# Return type

string

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: text/html

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

# GetEmailsPaginated

PageEmailProjection GetEmailsPaginated(ctx, optional)

Get all emails

By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *GetEmailsPaginatedOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a GetEmailsPaginatedOpts struct

Name Type Description Notes
inboxId optional.Interface of []string Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
page optional.Int32 Optional page index in email list pagination [default to 0]
size optional.Int32 Optional page size in email list pagination [default to 20]
sort optional.String Optional createdAt sort direction ASC or DESC [default to ASC]
unreadOnly optional.Bool Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly [default to false]

# Return type

PageEmailProjection

# 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]

# GetRawEmailContents

string GetRawEmailContents(ctx, emailId)

Get raw email string

Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email

# Return type

string

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

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

# GetRawEmailJson

RawEmailJson GetRawEmailJson(ctx, emailId)

Get raw email in JSON

Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email

# Return type

RawEmailJson

# 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]

# GetUnreadEmailCount

UnreadCount GetUnreadEmailCount(ctx, )

Get unread email count

Get number of emails unread

# Required Parameters

This endpoint does not need any parameter.

# Return type

UnreadCount

# 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]

# ValidateEmail

ValidationDto ValidateEmail(ctx, emailId)

Validate email

Validate the HTML content of email if HTML is found. Considered valid if no HTML.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
emailId string ID of email

# Return type

ValidationDto

# 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]