отправка писем в теории
This commit is contained in:
parent
bc26bac348
commit
002c09d2cf
@ -3,6 +3,7 @@ using VetclinicBusinessLogic.BusinessLogics;
|
||||
using VetclinicBusinessLogic.MailWorker;
|
||||
using VetclinicBusinessLogic.OfficePackage;
|
||||
using VetclinicBusinessLogic.OfficePackage.Implements;
|
||||
using VetclinicContracts.BindingModels;
|
||||
using VetclinicContracts.BusinessLogicsContracts;
|
||||
using VetclinicContracts.StoragesContracts;
|
||||
using VetclinicDatabaseImplement.Implements;
|
||||
@ -47,6 +48,24 @@ builder.Services.AddSwaggerGen( c =>
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
var mailSender = app.Services.GetService<AbstractMailWorker>();
|
||||
mailSender?.MailConfig(new MailConfigBindingModel
|
||||
{
|
||||
MailLogin = builder.Configuration?.GetSection("MailLogin")?.Value?.ToString()
|
||||
?? string.Empty,
|
||||
MailPassword =
|
||||
builder.Configuration?.GetSection("MailPassword")?.Value?.ToString() ??
|
||||
string.Empty,
|
||||
SmtpClientHost =
|
||||
builder.Configuration?.GetSection("SmtpClientHost")?.Value?.ToString() ??
|
||||
string.Empty,
|
||||
SmtpClientPort =
|
||||
Convert.ToInt32(builder.Configuration?.GetSection("SmtpClientPort")?.Value?.ToString()),
|
||||
PopHost = builder.Configuration?.GetSection("PopHost")?.Value?.ToString() ??
|
||||
string.Empty,
|
||||
PopPort = Convert.ToInt32(builder.Configuration?.GetSection("PopPort")?.Value?.ToString())
|
||||
});
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user