Table of Contents

Interface ISmtpSender

Namespace
FishMMO.ControlPanel.Services
Assembly
FishMMO-ControlPanel.dll

Delivers one message to the configured relay.

public interface ISmtpSender

Remarks

Separate from the queue on purpose: EmailQueueDrainService decides what to send and what to record afterwards, and this decides only how a message reaches a relay.

Properties

ConfigurationSummary

One line naming where mail goes, or why it goes nowhere. Safe to log: it never contains the username or the password.

string ConfigurationSummary { get; }

Property Value

string

IsConfigured

Whether this deployment has a relay worth talking to.

bool IsConfigured { get; }

Property Value

bool

Remarks

False is a supported state, not a fault. A panel brought up for development, or one standing in front of a shard whose mail goes out elsewhere, has no relay and should not be spending a database round trip every couple of seconds claiming messages it cannot deliver.

Methods

SendAsync(string, string, string, CancellationToken)

Sends one message, returning whether the relay accepted it.

Task<bool> SendAsync(string to, string subject, string body, CancellationToken cancellationToken = default)

Parameters

to string

Recipient address.

subject string

Subject line.

body string

The stored body, either plain text or HTML. Both parts are derived from it; see SmtpSender.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

True when the relay accepted the message; false for every failure, which is what the queue records as an attempt.