Table of Contents

Interface ITestingMessageResource

Namespace
Mailtrap.TestingMessages
Assembly
Mailtrap.Abstractions.dll

Represents testing message resource.

public interface ITestingMessageResource : IRestResource
Inherited Members

Methods

AsEml(CancellationToken)

Gets the message, represented by the current resource instance, in .eml format.

Task<string> AsEml(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<string>

Message in .eml format.

AsRaw(CancellationToken)

Gets the message, represented by the current resource instance, in a raw format.

Task<string> AsRaw(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<string>

Message in a raw format.

Attachment(long)

Gets resource for specific attachment, identified by attachmentId, for the message, represented by this resource instance.

IAttachmentResource Attachment(long attachmentId)

Parameters

attachmentId long

ID of attachment to get resource for.

Returns

IAttachmentResource

Resource for the attachment with specified ID.

Exceptions

ArgumentOutOfRangeException

When attachmentId is less than or equal to zero.

Attachments()

Gets attachment collection resource for the message, represented by this resource instance.

IAttachmentCollectionResource Attachments()

Returns

IAttachmentCollectionResource

Attachment collection resource for the message, represented by this resource instance.

Delete(CancellationToken)

Deletes the message, represented by the current resource instance, with all its attachments.

Task<TestingMessage> Delete(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<TestingMessage>

Deleted message details.

Remarks

All attachments, associated with the message, will be deleted as well.

After deletion of the message, represented by the current resource instance, it will be no longer available.
Thus any further operations on it will result in an error.

Forward(ForwardTestingMessageRequest, CancellationToken)

Forwards the message, represented by the current resource instance, to the email specified by request.

Task<ForwardTestingMessageResponse> Forward(ForwardTestingMessageRequest request, CancellationToken cancellationToken = default)

Parameters

request ForwardTestingMessageRequest

Request with forwarding details.

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<ForwardTestingMessageResponse>

Forwarding result details.

Remarks

The email address for forwarding must be confirmed by the recipient in advance.

GetDetails(CancellationToken)

Gets details of the message, represented by the current resource instance.

Task<TestingMessage> GetDetails(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to control operation cancellation.

Returns

Task<TestingMessage>

Requested message details.

GetHeaders(CancellationToken)

Gets headers of the message, represented by the current resource instance.

Task<TestingMessageHeaders> GetHeaders(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<TestingMessageHeaders>

Message headers.

GetHtmlAnalysisReport(CancellationToken)

Gets a brief HTML report for the message, represented by the current resource instance.

Task<TestingMessageHtmlReport> GetHtmlAnalysisReport(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<TestingMessageHtmlReport>

HTML analysis details for the message.

GetHtmlBody(CancellationToken)

Gets HTML body of the message (if exists), represented by the current resource instance.

Task<string> GetHtmlBody(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<string>

Message HTML body.

Remarks

Not applicable for plain text messages.

GetHtmlSource(CancellationToken)

Gets HTML source of the message, represented by the current resource instance.

Task<string> GetHtmlSource(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<string>

Message HTML source.

GetSpamReport(CancellationToken)

Gets a brief spam report for the message, represented by the current resource instance.

Task<TestingMessageSpamReport> GetSpamReport(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<TestingMessageSpamReport>

Spam report details for the message.

GetTextBody(CancellationToken)

Gets a plain text body of the message (if exists), represented by the current resource instance.

Task<string> GetTextBody(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<string>

Message plain text body.

Update(UpdateTestingMessageRequest, CancellationToken)

Updates the message, represented by the current resource instance, with details specified by request.

Task<TestingMessage> Update(UpdateTestingMessageRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateTestingMessageRequest

Message details for update.

cancellationToken CancellationToken
Token to control operation cancellation.

Returns

Task<TestingMessage>

Updated message details.