Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 30b3fb6

Browse files
committed
Aggiunto metodo statico MailKit
1 parent 5f36623 commit 30b3fb6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/NET6CustomLibrary/Extensions/DependencyInjection.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,18 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
192192
return builder;
193193
}
194194
#endregion
195+
196+
#region "MAILKIT"
197+
public static IServiceCollection AddMailKitEmailSenderService(this IServiceCollection services, IConfiguration configuration)
198+
{
199+
services
200+
.AddSingleton<IEmailSender, MailKitEmailSender>()
201+
.AddSingleton<IEmailClient, MailKitEmailSender>();
202+
203+
services
204+
.Configure<SmtpOptions>(configuration.GetSection("Smtp"));
205+
206+
return services;
207+
}
208+
#endregion
195209
}

0 commit comments

Comments
 (0)