Pull Request 33520 suggestions Injected AppSettings instead of using GetEnvironmentVariable at Services level When debugging only app.Services.GetRequiredService<IPCRBService>(); Get ready to use VSCode IDE Align .editorconfig files
20 lines
475 B
C#
20 lines
475 B
C#
using System.Net.Mail;
|
|
|
|
namespace FabApprovalWorkerService.Clients;
|
|
|
|
public interface ISmtpClientWrapper {
|
|
void Send(MailMessage message);
|
|
}
|
|
|
|
public class SmtpClientWrapper : ISmtpClientWrapper {
|
|
private SmtpClient _client;
|
|
|
|
public SmtpClientWrapper(SmtpClient client) {
|
|
_client = client ??
|
|
throw new ArgumentNullException("SmtpClient not injected");
|
|
}
|
|
|
|
public void Send(MailMessage message) {
|
|
_client.Send(message);
|
|
}
|
|
} |