diff --git a/SushiBar/SushiBar/App.config b/SushiBar/SushiBar/App.config index 5358022..d70523f 100644 --- a/SushiBar/SushiBar/App.config +++ b/SushiBar/SushiBar/App.config @@ -2,10 +2,10 @@ - + - + \ No newline at end of file diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs index 71147c3..c724cbd 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs @@ -156,18 +156,26 @@ namespace SushiBarBusinessLogic.BusinessLogics } private bool SendOrderStatusMail(int clientId, string subject, string text) { - var client = _clientLogic.ReadElement(new() { Id = clientId }); - if (client == null) + try + { + var client = _clientLogic.ReadElement(new() { Id = clientId }); + if (client == null) + { + return false; + } + _mailWorker.MailSendAsync(new() + { + MailAddress = client.Email, + Subject = subject, + Text = text + }); + return true; + } + catch (Exception ex) { return false; } - _mailWorker.MailSendAsync(new() - { - MailAddress = client.Email, - Subject = subject, - Text = text - }); - return true; + } } } diff --git a/SushiBar/SushiBarRestApi/appsettings.json b/SushiBar/SushiBarRestApi/appsettings.json index eca666a..51e8ab6 100644 --- a/SushiBar/SushiBarRestApi/appsettings.json +++ b/SushiBar/SushiBarRestApi/appsettings.json @@ -9,12 +9,12 @@ "MailConfigBindingModel": { "SmtpClientHost": "smtp.yandex.ru", - "SmtpClientPort": 465, + "SmtpClientPort": 587, "PopHost": "pop.yandex.com", "PopPort": 995, - "MailLogin": "tester.b.moio@ya.ru", + "MailLogin": "tester.b.moio@yandex.ru", "MailPassword": "pyzzqswchjevecec" } }