maislurp-client-powershell.maislurp-client-powershell/Api.EmailControllerApi

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

MethodHTTP requestDescription
Invoke-DeleteAllEmailsDELETE /emailsDelete all emails in all inboxes.
Invoke-DeleteEmailDELETE /emails/{emailId}Delete an email
Invoke-DownloadAttachmentGET /emails/{emailId}/attachments/{attachmentId}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.
Invoke-DownloadAttachmentBase64GET /emails/{emailId}/attachments/{attachmentId}/base64Get 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.
Invoke-DownloadBodyGET /emails/{emailId}/bodyGet email body as string. Returned as plain/text with content type header.
Invoke-DownloadBodyBytesGET /emails/{emailId}/body-bytesGet email body in bytes. Returned as octet-stream with content type header.
Invoke-ForwardEmailPOST /emails/{emailId}/forwardForward email to recipients
Get-AttachmentMetaDataGET /emails/{emailId}/attachments/{attachmentId}/metadataGet email attachment metadata. This is the contentType and contentLength of an attachment. To get the individual attachments use the downloadAttachment methods.
Get-Attachments1GET /emails/{emailId}/attachmentsGet all email attachment metadata. Metadata includes name and size of attachments.
Get-EmailGET /emails/{emailId}Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.
Get-EmailContentMatchPOST /emails/{emailId}/contentMatchGet email content regex pattern match results. Runs regex against email body and returns match groups.
Get-EmailCountGET /emails/emails/countGet email count
Get-EmailHTMLGET /emails/{emailId}/htmlGet email content as HTML. For displaying emails in browser context.
Get-EmailHTMLQueryGET /emails/{emailId}/htmlQueryParse and return text from an email, stripping HTML and decoding encoded characters
Get-EmailLinksGET /emails/{emailId}/linksParse and return list of links found in an email (only works for HTML content)
Get-EmailTextLinesGET /emails/{emailId}/textLinesParse and return text from an email, stripping HTML and decoding encoded characters
Get-EmailsPaginatedGET /emailsGet all emails in all inboxes in paginated form. Email API list all.
Get-GravatarUrlForEmailAddressGET /emails/gravatarForGet gravatar url for email address
Get-LatestEmailGET /emails/latestGet latest email in all inboxes. Most recently received.
Get-LatestEmailInInboxGET /emails/latestInGet latest email in an inbox. Use WaitForController to get emails that may not have arrived yet.
Get-OrganizationEmailsPaginatedGET /emails/organizationGet all organization emails. List team or shared test email accounts
Get-RawEmailContentsGET /emails/{emailId}/rawGet raw email string. Returns unparsed raw SMTP message with headers and body.
Get-RawEmailJsonGET /emails/{emailId}/raw/jsonGet raw email in JSON. Unparsed SMTP message in JSON wrapper format.
Get-UnreadEmailCountGET /emails/unreadCountGet unread email count
Invoke-MarkAsReadPATCH /emails/{emailId}/readMark an email as read on unread
Invoke-ReplyToEmailPUT /emails/{emailId}Reply to an email
Send-EmailSourceOptionalPOST /emailsSend email
Confirm-EmailPOST /emails/{emailId}/validateValidate email HTML contents

Invoke-DeleteAllEmails

void Invoke-DeleteAllEmails

Delete all emails in all inboxes.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"


# Delete all emails in all inboxes.
try {
     $Result = Invoke-DeleteAllEmails
} catch {
    Write-Host ("Exception occured when calling Invoke-DeleteAllEmails: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

This endpoint does not need any parameter.

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 ]

Invoke-DeleteEmail

void Invoke-DeleteEmail         [-EmailId]

Delete an email

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email to delete

# Delete an email
try {
     $Result = Invoke-DeleteEmail -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Invoke-DeleteEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email to delete

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 ]

Invoke-DownloadAttachment

SystemByte Invoke-DownloadAttachment         [-AttachmentId]         [-EmailId]         [-ApiKey]

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.

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.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AttachmentId = "AttachmentId_example" # String | ID of attachment
$EmailId = "EmailId_example" # String | ID of email
$ApiKey = "ApiKey_example" # 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. (optional)

# 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.
try {
     $Result = Invoke-DownloadAttachment -AttachmentId $AttachmentId -EmailId $EmailId -ApiKey $ApiKey
} catch {
    Write-Host ("Exception occured when calling Invoke-DownloadAttachment: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AttachmentIdStringID of attachment
EmailIdStringID of email
ApiKeyStringCan 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.[optional]

Return type

SystemByte (PSCustomObject)

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 ]

Invoke-DownloadAttachmentBase64

DownloadAttachmentDto Invoke-DownloadAttachmentBase64         [-AttachmentId]         [-EmailId]

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.

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.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AttachmentId = "AttachmentId_example" # String | ID of attachment
$EmailId = "EmailId_example" # String | ID of email

# 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`.
try {
     $Result = Invoke-DownloadAttachmentBase64 -AttachmentId $AttachmentId -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Invoke-DownloadAttachmentBase64: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AttachmentIdStringID of attachment
EmailIdStringID of email

Return type

DownloadAttachmentDto (PSCustomObject)

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 ]

Invoke-DownloadBody

String Invoke-DownloadBody         [-EmailId]

Get email body as string. Returned as plain/text with content type header.

Returns the specified email body for a given email as a string

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Get email body as string. Returned as `plain/text` with content type header.
try {
     $Result = Invoke-DownloadBody -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Invoke-DownloadBody: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email

Return type

String

Authorization

API_KEY

HTTP request headers

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

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

Invoke-DownloadBodyBytes

SystemByte Invoke-DownloadBodyBytes         [-EmailId]

Get email body in bytes. Returned as octet-stream with content type header.

Returns the specified email body for a given email as a stream / array of bytes.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Get email body in bytes. Returned as `octet-stream` with content type header.
try {
     $Result = Invoke-DownloadBodyBytes -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Invoke-DownloadBodyBytes: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email

Return type

SystemByte (PSCustomObject)

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 ]

Invoke-ForwardEmail

SentEmailDto Invoke-ForwardEmail         [-EmailId]         [-ForwardEmailOptions]

Forward email to recipients

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.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email
$ForwardEmailOptions = (Initialize-ForwardEmailOptions -Bcc @("Bcc_example") -Cc @("Cc_example") -VarFrom "VarFrom_example" -Subject "Subject_example" -To @("To_example") -UseInboxName $false) # ForwardEmailOptions | forwardEmailOptions

# Forward email to recipients
try {
     $Result = Invoke-ForwardEmail -EmailId $EmailId -ForwardEmailOptions $ForwardEmailOptions
} catch {
    Write-Host ("Exception occured when calling Invoke-ForwardEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email
ForwardEmailOptionsForwardEmailOptionsforwardEmailOptions

Return type

SentEmailDto (PSCustomObject)

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 ]

Get-AttachmentMetaData

AttachmentMetaData Get-AttachmentMetaData         [-AttachmentId]         [-EmailId]

Get email attachment metadata. This is the contentType and contentLength of an attachment. To get the individual attachments use the downloadAttachment methods.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$AttachmentId = "AttachmentId_example" # String | ID of attachment
$EmailId = "EmailId_example" # String | ID of email

# Get email attachment metadata. This is the `contentType` and `contentLength` of an attachment. To get the individual attachments  use the `downloadAttachment` methods.
try {
     $Result = Get-AttachmentMetaData -AttachmentId $AttachmentId -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Get-AttachmentMetaData: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
AttachmentIdStringID of attachment
EmailIdStringID of email

Return type

AttachmentMetaData (PSCustomObject)

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 ]

Get-Attachments1

AttachmentMetaData[] Get-Attachments1         [-EmailId]

Get all email attachment metadata. Metadata includes name and size of attachments.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Get all email attachment metadata. Metadata includes name and size of attachments.
try {
     $Result = Get-Attachments1 -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Get-Attachments1: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email

Return type

**AttachmentMetaData[]** (PSCustomObject)

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 ]

Get-Email

Email Get-Email         [-EmailId]         [-Decode] <System.Nullable[Boolean]>

Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | emailId
$Decode = true # Boolean | 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 (optional) (default to $false)

# Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.
try {
     $Result = Get-Email -EmailId $EmailId -Decode $Decode
} catch {
    Write-Host ("Exception occured when calling Get-Email: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringemailId
DecodeBooleanDecode 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[optional] [default to $false]

Return type

Email (PSCustomObject)

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 ]

Get-EmailContentMatch

EmailContentMatchResult Get-EmailContentMatch         [-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/ for more information of available patterns.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email to match against
$ContentMatchOptions = (Initialize-ContentMatchOptions -Pattern "Pattern_example") # ContentMatchOptions | contentMatchOptions

# Get email content regex pattern match results. Runs regex against email body and returns match groups.
try {
     $Result = Get-EmailContentMatch -EmailId $EmailId -ContentMatchOptions $ContentMatchOptions
} catch {
    Write-Host ("Exception occured when calling Get-EmailContentMatch: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email to match against
ContentMatchOptionsContentMatchOptionscontentMatchOptions

Return type

EmailContentMatchResult (PSCustomObject)

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 ]

Get-EmailCount

CountDto Get-EmailCount

Get email count

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"


# Get email count
try {
     $Result = Get-EmailCount
} catch {
    Write-Host ("Exception occured when calling Get-EmailCount: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

This endpoint does not need any parameter.

Return type

CountDto (PSCustomObject)

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 ]

Get-EmailHTML

String Get-EmailHTML         [-EmailId]         [-Decode] <System.Nullable[Boolean]>

Get email content as HTML. For displaying emails in browser context.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | emailId
$Decode = true # Boolean | decode (optional) (default to $false)

# Get email content as HTML. For displaying emails in browser context.
try {
     $Result = Get-EmailHTML -EmailId $EmailId -Decode $Decode
} catch {
    Write-Host ("Exception occured when calling Get-EmailHTML: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringemailId
DecodeBooleandecode[optional] [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 ]

Get-EmailHTMLQuery

EmailTextLinesResult Get-EmailHTMLQuery         [-EmailId]         [-HtmlSelector]

Parse and return text from an email, stripping HTML and decoding encoded characters

Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email to perform HTML query on
$HtmlSelector = "HtmlSelector_example" # String | HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/ for more information. (optional)

# Parse and return text from an email, stripping HTML and decoding encoded characters
try {
     $Result = Get-EmailHTMLQuery -EmailId $EmailId -HtmlSelector $HtmlSelector
} catch {
    Write-Host ("Exception occured when calling Get-EmailHTMLQuery: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email to perform HTML query on
HtmlSelectorStringHTML selector to search for. Uses JQuery/JSoup/CSS style selector like ‘.my-div’ to match content. See https://jsoup.org/apidocs/org/jsoup/select/ for more information.[optional]

Return type

EmailTextLinesResult (PSCustomObject)

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 ]

EmailLinksResult Get-EmailLinks         [-EmailId]

Parse and return list of links found in an email (only works for HTML content)

HTML parsing uses JSoup and UNIX line separators. Searches content for href attributes

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email to fetch text for

# Parse and return list of links found in an email (only works for HTML content)
try {
     $Result = Get-EmailLinks -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Get-EmailLinks: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email to fetch text for

Return type

EmailLinksResult (PSCustomObject)

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 ]

Get-EmailTextLines

EmailTextLinesResult Get-EmailTextLines         [-EmailId]         [-DecodeHtmlEntities] <System.Nullable[Boolean]>         [-LineSeparator]

Parse and return text from an email, stripping HTML and decoding encoded characters

Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email to fetch text for
$DecodeHtmlEntities = true # Boolean | Decode HTML entities (optional)
$LineSeparator = "LineSeparator_example" # String | Line separator character (optional)

# Parse and return text from an email, stripping HTML and decoding encoded characters
try {
     $Result = Get-EmailTextLines -EmailId $EmailId -DecodeHtmlEntities $DecodeHtmlEntities -LineSeparator $LineSeparator
} catch {
    Write-Host ("Exception occured when calling Get-EmailTextLines: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email to fetch text for
DecodeHtmlEntitiesBooleanDecode HTML entities[optional]
LineSeparatorStringLine separator character[optional]

Return type

EmailTextLinesResult (PSCustomObject)

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 ]

Get-EmailsPaginated

PageEmailProjection Get-EmailsPaginated         [-Before] <System.Nullable[System.DateTime]>         [-InboxId] <String[]>         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]         [-UnreadOnly] <System.Nullable[Boolean]>

Get all emails in all inboxes in paginated form. Email API list all.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$Before = Get-Date # System.DateTime | Optional filter emails received before given date time (optional)
$InboxId = @("Inner_example") # String[] | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
$Page = 987 # Int32 | Optional page  in email list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body (optional) (default to "false")
$Since = Get-Date # System.DateTime | Optional filter emails received after given date time (optional)
$Size = 987 # Int32 | Optional page size in email list pagination. Maximum size is 100. Use page  and sort to page through larger results (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")
$UnreadOnly = true # Boolean | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional) (default to $false)

# Get all emails in all inboxes in paginated form. Email API list all.
try {
     $Result = Get-EmailsPaginated -Before $Before -InboxId $InboxId -Page $Page -SearchFilter $SearchFilter -Since $Since -Size $Size -Sort $Sort -UnreadOnly $UnreadOnly
} catch {
    Write-Host ("Exception occured when calling Get-EmailsPaginated: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
BeforeSystem.DateTimeOptional filter emails received before given date time[optional]
InboxId**String[]**Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.[optional]
PageInt32Optional page in email list pagination[optional] [default to 0]
SearchFilterStringOptional search filter. Searches email recipients, sender, subject, email address and ID. Does not search email body[optional] [default to “false”]
SinceSystem.DateTimeOptional filter emails received after given date time[optional]
SizeInt32Optional page size in email list pagination. Maximum size is 100. Use page and sort to page through larger results[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]
UnreadOnlyBooleanOptional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly[optional] [default to $false]

Return type

PageEmailProjection (PSCustomObject)

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 ]

Get-GravatarUrlForEmailAddress

GravatarUrl Get-GravatarUrlForEmailAddress         [-EmailAddress]         [-Size]

Get gravatar url for email address

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailAddress = "EmailAddress_example" # String | emailAddress
$Size = "Size_example" # String | size (optional)

# Get gravatar url for email address
try {
     $Result = Get-GravatarUrlForEmailAddress -EmailAddress $EmailAddress -Size $Size
} catch {
    Write-Host ("Exception occured when calling Get-GravatarUrlForEmailAddress: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailAddressStringemailAddress
SizeStringsize[optional]

Return type

GravatarUrl (PSCustomObject)

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 ]

Get-LatestEmail

Email Get-LatestEmail         [-InboxIds] <String[]>

Get latest email in all inboxes. Most recently received.

Get the newest email in all inboxes or in a passed set of inbox IDs

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$InboxIds = @("Inner_example") # String[] | Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes (optional)

# Get latest email in all inboxes. Most recently received.
try {
     $Result = Get-LatestEmail -InboxIds $InboxIds
} catch {
    Write-Host ("Exception occured when calling Get-LatestEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIds**String[]**Optional set of inboxes to filter by. Only get the latest email from these inbox IDs. If not provided will search across all inboxes[optional]

Return type

Email (PSCustomObject)

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 ]

Get-LatestEmailInInbox

Email Get-LatestEmailInInbox         [-InboxId]

Get latest email in an inbox. Use WaitForController to get emails that may not have arrived yet.

Get the newest email in all inboxes or in a passed set of inbox IDs

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$InboxId = "InboxId_example" # String | ID of the inbox you want to get the latest email from (optional)

# Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet.
try {
     $Result = Get-LatestEmailInInbox -InboxId $InboxId
} catch {
    Write-Host ("Exception occured when calling Get-LatestEmailInInbox: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIdStringID of the inbox you want to get the latest email from[optional]

Return type

Email (PSCustomObject)

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 ]

Get-OrganizationEmailsPaginated

PageEmailProjection Get-OrganizationEmailsPaginated         [-Before] <System.Nullable[System.DateTime]>         [-InboxId] <String[]>         [-Page] <System.Nullable[Int32]>         [-SearchFilter]         [-Since] <System.Nullable[System.DateTime]>         [-Size] <System.Nullable[Int32]>         [-Sort]         [-UnreadOnly] <System.Nullable[Boolean]>

Get all organization emails. List team or shared test email accounts

By default returns all emails across all team 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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$Before = Get-Date # System.DateTime | Optional filter emails received before given date time (optional)
$InboxId = @("Inner_example") # String[] | Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account. (optional)
$Page = 987 # Int32 | Optional page  in email list pagination (optional) (default to 0)
$SearchFilter = "SearchFilter_example" # String | Optional search filter search filter for emails. (optional)
$Since = Get-Date # System.DateTime | Optional filter emails received after given date time (optional)
$Size = 987 # Int32 | Optional page size in email list pagination. Maximum size is 100. Use page  and sort to page through larger results (optional) (default to 20)
$Sort = "ASC" # String | Optional createdAt sort direction ASC or DESC (optional) (default to "ASC")
$UnreadOnly = true # Boolean | Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (optional) (default to $false)

# Get all organization emails. List team or shared test email accounts
try {
     $Result = Get-OrganizationEmailsPaginated -Before $Before -InboxId $InboxId -Page $Page -SearchFilter $SearchFilter -Since $Since -Size $Size -Sort $Sort -UnreadOnly $UnreadOnly
} catch {
    Write-Host ("Exception occured when calling Get-OrganizationEmailsPaginated: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
BeforeSystem.DateTimeOptional filter emails received before given date time[optional]
InboxId**String[]**Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.[optional]
PageInt32Optional page in email list pagination[optional] [default to 0]
SearchFilterStringOptional search filter search filter for emails.[optional]
SinceSystem.DateTimeOptional filter emails received after given date time[optional]
SizeInt32Optional page size in email list pagination. Maximum size is 100. Use page and sort to page through larger results[optional] [default to 20]
SortStringOptional createdAt sort direction ASC or DESC[optional] [default to “ASC”]
UnreadOnlyBooleanOptional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly[optional] [default to $false]

Return type

PageEmailProjection (PSCustomObject)

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 ]

Get-RawEmailContents

String Get-RawEmailContents         [-EmailId]

Get raw email string. Returns unparsed raw SMTP message with headers and body.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Get raw email string. Returns unparsed raw SMTP message with headers and body.
try {
     $Result = Get-RawEmailContents -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Get-RawEmailContents: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID 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 ]

Get-RawEmailJson

RawEmailJson Get-RawEmailJson         [-EmailId]

Get raw email in JSON. Unparsed SMTP message in JSON wrapper format.

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Get raw email in JSON. Unparsed SMTP message in JSON wrapper format.
try {
     $Result = Get-RawEmailJson -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Get-RawEmailJson: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email

Return type

RawEmailJson (PSCustomObject)

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 ]

Get-UnreadEmailCount

UnreadCount Get-UnreadEmailCount

Get unread email count

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"


# Get unread email count
try {
     $Result = Get-UnreadEmailCount
} catch {
    Write-Host ("Exception occured when calling Get-UnreadEmailCount: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

This endpoint does not need any parameter.

Return type

UnreadCount (PSCustomObject)

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 ]

Invoke-MarkAsRead

EmailPreview Invoke-MarkAsRead         [-EmailId]         [-Read] <System.Nullable[Boolean]>

Mark an email as read on unread

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | emailId
$Read = true # Boolean | What value to assign to email read property. Default true. (optional) (default to $true)

# Mark an email as read on unread
try {
     $Result = Invoke-MarkAsRead -EmailId $EmailId -Read $Read
} catch {
    Write-Host ("Exception occured when calling Invoke-MarkAsRead: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringemailId
ReadBooleanWhat value to assign to email read property. Default true.[optional] [default to $true]

Return type

EmailPreview (PSCustomObject)

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 ]

Invoke-ReplyToEmail

SentEmailDto Invoke-ReplyToEmail         [-EmailId]         [-ReplyToEmailOptions]

Reply to an email

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.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of the email that should be replied to
$ReplyToEmailOptions = (Initialize-ReplyToEmailOptions -Attachments @("Attachments_example") -Body "Body_example" -Charset "Charset_example" -VarFrom "VarFrom_example" -IsHTML $false -ReplyTo "ReplyTo_example" -SendStrategy "SINGLE_MESSAGE" -Template "Template_example" -TemplateVariables "TODO" -UseInboxName $false) # ReplyToEmailOptions | replyToEmailOptions

# Reply to an email
try {
     $Result = Invoke-ReplyToEmail -EmailId $EmailId -ReplyToEmailOptions $ReplyToEmailOptions
} catch {
    Write-Host ("Exception occured when calling Invoke-ReplyToEmail: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of the email that should be replied to
ReplyToEmailOptionsReplyToEmailOptionsreplyToEmailOptions

Return type

SentEmailDto (PSCustomObject)

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 ]

Send-EmailSourceOptional

void Send-EmailSourceOptional         [-InboxId]         [-UseDomainPool] <System.Nullable[Boolean]>         [-SendEmailOptions]

Send email

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.

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$InboxId = "InboxId_example" # String | ID of the inbox you want to send the email from (optional)
$UseDomainPool = true # Boolean | Use domain pool. Optionally create inbox to send from using the mailslurp domain pool. (optional)
$SendEmailOptions = (Initialize-SendEmailOptions -AddTrackingPixel $false -Attachments @("Attachments_example") -Bcc @("Bcc_example") -Body "Body_example" -Cc @("Cc_example") -Charset "Charset_example" -VarFrom "VarFrom_example" -Html $false -IsHTML $false -ReplyTo "ReplyTo_example" -SendStrategy "SINGLE_MESSAGE" -Subject "Subject_example" -Template "Template_example" -TemplateVariables "TODO" -To @("To_example") -ToContacts @("ToContacts_example") -ToGroup "ToGroup_example" -UseInboxName $false) # SendEmailOptions | Options for the email (optional)

# Send email
try {
     $Result = Send-EmailSourceOptional -InboxId $InboxId -UseDomainPool $UseDomainPool -SendEmailOptions $SendEmailOptions
} catch {
    Write-Host ("Exception occured when calling Send-EmailSourceOptional: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
InboxIdStringID of the inbox you want to send the email from[optional]
UseDomainPoolBooleanUse domain pool. Optionally create inbox to send from using the mailslurp domain pool.[optional]
SendEmailOptionsSendEmailOptionsOptions for the email[optional]

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 ]

Confirm-Email

ValidationDto Confirm-Email         [-EmailId]

Validate email HTML contents

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

Example

# general setting of the PowerShell module, e.g. base URL, authentication, etc
$Configuration = Get-Configuration
# Configure API key authorization: API_KEY
$Configuration.ApiKey.x-api-key = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration.ApiKeyPrefix.x-api-key = "Bearer"

$EmailId = "EmailId_example" # String | ID of email

# Validate email HTML contents
try {
     $Result = Confirm-Email -EmailId $EmailId
} catch {
    Write-Host ("Exception occured when calling Confirm-Email: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
    Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
}

Parameters

NameTypeDescriptionNotes
EmailIdStringID of email

Return type

ValidationDto (PSCustomObject)

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 ]