Class EmailControllerApi

Hierarchy

Constructors

Properties

configuration: Configuration = ...

Methods

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

    Parameters

    • Optional initOverrides: RequestInit

    Returns Promise<void>

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

    Parameters

    • Optional initOverrides: RequestInit

    Returns Promise<ApiResponse<void>>

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

    Parameters

    Returns Promise<void>

  • 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. Get email attachment bytes. Returned as octet-stream with content type header. If you have trouble with byte responses try the downloadAttachmentBase64 response endpoints and convert the base 64 encoded content to a file or string.

    Parameters

    Returns Promise<string>

  • 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. Get email attachment as base64 encoded string as an alternative to binary responses. Decode the base64FileContents as a utf-8 encoded string or array of bytes depending on the contentType.

    Parameters

    Returns Promise<DownloadAttachmentDto>

  • 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. Get email attachment as base64 encoded string as an alternative to binary responses. Decode the base64FileContents as a utf-8 encoded string or array of bytes depending on the contentType.

    Parameters

    Returns Promise<ApiResponse<DownloadAttachmentDto>>

  • 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. Get email attachment bytes. Returned as octet-stream with content type header. If you have trouble with byte responses try the downloadAttachmentBase64 response endpoints and convert the base 64 encoded content to a file or string.

    Parameters

    Returns Promise<ApiResponse<string>>

  • Returns the specified email body for a given email as a string Get email body as string. Returned as plain/text with content type header.

    Parameters

    Returns Promise<string>

  • Returns the specified email body for a given email as a stream / array of bytes. Get email body in bytes. Returned as octet-stream with content type header.

    Parameters

    Returns Promise<string>

  • Returns the specified email body for a given email as a string Get email body as string. Returned as plain/text with content type header.

    Parameters

    Returns Promise<ApiResponse<string>>

  • Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the from option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints. Forward email to recipients

    Parameters

    Returns Promise<SentEmailDto>

  • Forward an existing email to new recipients. The sender of the email will be the inbox that received the email you are forwarding. You can override the sender with the from option. Note you must have access to the from address in MailSlurp to use the override. For more control consider fetching the email and sending it a new using the send email endpoints. Forward email to recipients

    Parameters

    Returns Promise<ApiResponse<SentEmailDto>>

  • Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.

    Parameters

    Returns Promise<Email>

  • Get email count

    Parameters

    • Optional initOverrides: RequestInit

    Returns Promise<CountDto>

  • 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. Returns content-type text/html;charset=utf-8 so you must call expecting that content response not JSON. For JSON response see the getEmailHTMLJson method. Get email content as HTML. For displaying emails in browser context.

    Parameters

    Returns Promise<string>

  • Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type application/json;charset=utf-8 so you must call expecting that content response not JSON. Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content

    Parameters

    Returns Promise<EmailHtmlDto>

  • Retrieve email content as HTML response. Decodes quoted-printable entities and converts charset to UTF-8. Returns content-type application/json;charset=utf-8 so you must call expecting that content response not JSON. Get email content as HTML in JSON wrapper. For fetching entity decoded HTML content

    Parameters

    Returns Promise<ApiResponse<EmailHtmlDto>>

  • 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. Returns content-type text/html;charset=utf-8 so you must call expecting that content response not JSON. For JSON response see the getEmailHTMLJson method. Get email content as HTML. For displaying emails in browser context.

    Parameters

    Returns Promise<ApiResponse<string>>

  • Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.

    Parameters

    Returns Promise<ApiResponse<Email>>

  • 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 Get all emails in all inboxes in paginated form. Email API list all.

    Parameters

    Returns Promise<PageEmailProjection>

  • Get the newest email in all inboxes or in a passed set of inbox IDs Get latest email in all inboxes. Most recently received.

    Parameters

    Returns Promise<Email>

  • 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 Get raw email string. Returns unparsed raw SMTP message with headers and body.

    Parameters

    Returns Promise<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 Get raw email string. Returns unparsed raw SMTP message with headers and body.

    Parameters

    Returns Promise<ApiResponse<string>>

  • Returns a raw, unparsed, and unprocessed email wrapped in a JSON response object for easier handling when compared with the getRawEmail text/plain response Get raw email in JSON. Unparsed SMTP message in JSON wrapper format.

    Parameters

    Returns Promise<RawEmailJson>

  • Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response Get unread email count

    Parameters

    • Optional initOverrides: RequestInit

    Returns Promise<UnreadCount>

  • Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response Get unread email count

    Parameters

    • Optional initOverrides: RequestInit

    Returns Promise<ApiResponse<UnreadCount>>

  • Marks an email as read or unread. Pass boolean read flag to set value. This is useful if you want to read an email but keep it as unread Mark an email as read on unread

    Parameters

    Returns Promise<EmailPreview>

  • Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails to, cc, and bcc. Reply to an email

    Parameters

    Returns Promise<SentEmailDto>

  • Alias for InboxController.sendEmail method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email. Send email

    Parameters

    Returns Promise<void>

  • Alias for InboxController.sendEmail method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email. Send email

    Parameters

    Returns Promise<ApiResponse<void>>