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