Table of Contents

Method DeliverAsync

Namespace
MailFathom.Application.Mail.Delivery.Outbox
Assembly
MailFathom.Application.dll

DeliverAsync(ClaimedOutgoingEmail, MailTransportSecurityPolicy, CancellationToken)

Attempts one claimed send and records what became of it.

[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Every way an attempt can end has to reach the record, because a submission that left the deployment and was not written down is the one failure this design exists to remove; the failure is classified into a recorded code rather than swallowed.")]
public Task<MailOutboxDeliveryResult> DeliverAsync(ClaimedOutgoingEmail claimed, MailTransportSecurityPolicy transportSecurityPolicy, CancellationToken stoppingToken)

Parameters

claimed ClaimedOutgoingEmail

The send this attempt holds, with the lease it holds it under.

transportSecurityPolicy MailTransportSecurityPolicy

The connection and authentication policy the submission obeys.

stoppingToken CancellationToken

Stops the attempt when the host is shutting down.

Returns

Task<MailOutboxDeliveryResult>

What the attempt did, which is already durable by the time it is returned.

Remarks

It does not raise for a send that failed. Everything the attempt learned is written onto the record first, so a caller reads the outcome rather than catching it — which is what lets one send's failure leave the sends beside it untouched.

Exceptions

ArgumentNullException

Thrown when claimed or transportSecurityPolicy is null.