Guest User

Untitled

a guest
Jun 14th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. // ... Usings
  2. using Microsoft.AspNetCore.Identity.UI.Services;
  3. using MailSenderApp.Services;
  4.  
  5. namespace MailSenderApp {
  6. public class Startup {
  7.  
  8. // ... Startup initializer and other methods
  9.  
  10. public void ConfigureServices(IServiceCollection services)
  11. {
  12. // ... Other services
  13. services.AddDefaultIdentity<IdentityUser>().AddEntityFrameworkStores<ApplicationDbContext>();
  14.  
  15. services.AddTransient<IEmailSender, EmailSender>(i =>
  16. new EmailSender(
  17. Configuration["EmailSender:Host"],
  18. Configuration.GetValue<int>("EmailSender:Port"),
  19. Configuration.GetValue<bool>("EmailSender:EnableSSL"),
  20. Configuration["EmailSender:UserName"],
  21. Configuration["EmailSender:Password"]
  22. )
  23. );
  24.  
  25. services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment