Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ... Usings
- using Microsoft.AspNetCore.Identity.UI.Services;
- using MailSenderApp.Services;
- namespace MailSenderApp {
- public class Startup {
- // ... Startup initializer and other methods
- public void ConfigureServices(IServiceCollection services)
- {
- // ... Other services
- services.AddDefaultIdentity<IdentityUser>().AddEntityFrameworkStores<ApplicationDbContext>();
- services.AddTransient<IEmailSender, EmailSender>(i =>
- new EmailSender(
- Configuration["EmailSender:Host"],
- Configuration.GetValue<int>("EmailSender:Port"),
- Configuration.GetValue<bool>("EmailSender:EnableSSL"),
- Configuration["EmailSender:UserName"],
- Configuration["EmailSender:Password"]
- )
- );
- services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
- }
- }
- }
Add Comment
Please, Sign In to add comment