-
Notifications
You must be signed in to change notification settings - Fork 0
/
IEmailSender.cs
30 lines (28 loc) · 1.36 KB
/
IEmailSender.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Threading;
using System.Threading.Tasks;
namespace MailkitTools
{
/// <summary>
/// Specifies the data contract required for a service that sends e-mails.
/// </summary>
public interface IEmailSender
{
/// <summary>
/// Asynchronously send an e-mail using the specified parameters.
/// </summary>
/// <param name="subject">The subject of the message.</param>
/// <param name="body">The body of the message.</param>
/// <param name="from">A comma- (or semi-colon) separated list of addresses in the 'From' header.</param>
/// <param name="to">A comma- (or semi-colon) separated list of addresses in the 'To' header.</param>
/// <param name="cancellationToken">The token used to cancel an ongoing async operation.</param>
/// <returns></returns>
Task SendEmailAsync(string subject, string body, string from, string to, CancellationToken cancellationToken = default);
/// <summary>
/// Send the specified message asynchronously.
/// </summary>
/// <param name="message">The message to send.</param>
/// <param name="cancellationToken">The token used to cancel an ongoing async operation.</param>
/// <returns></returns>
Task SendEmailAsync(MimeKit.MimeMessage message, CancellationToken cancellationToken = default);
}
}