Files
mixtape/zero.Core/Mails/IMailDispatcher.cs
T

26 lines
649 B
C#

using System;
using System.Net.Mail;
using System.Threading;
using System.Threading.Tasks;
namespace zero.Core.Mails
{
public interface IMailDispatcher : IDisposable
{
/// <summary>
/// Adds a new mail message to the outgoing queue
/// </summary>
void Enqueue(Mail message);
/// <summary>
/// Sends all mails which have been added to the queue previously
/// </summary>
Task Send(CancellationToken token = default);
/// <summary>
/// Whether a certain sender signature is supported by this dispatcher
/// </summary>
Task<bool> IsSenderSupported(string email) => Task.FromResult(true);
}
}