From 9b61706f557136b9a026b810130371b27ab42fed Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 1 Mar 2024 12:06:42 +0500 Subject: [PATCH] =?UTF-8?q?SmtpException=20=D0=BF=D1=80=D0=B8=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B5=20=D1=83=D0=B2=D0=B5?= =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=BD=D0=B0=20=D0=BE=D1=82=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D1=8F=D1=82=D1=8C=D1=81=D1=8F=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Notifications/NotificationService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/AsbCloudApp/Services/Notifications/NotificationService.cs b/AsbCloudApp/Services/Notifications/NotificationService.cs index d0414213..d703ffb4 100644 --- a/AsbCloudApp/Services/Notifications/NotificationService.cs +++ b/AsbCloudApp/Services/Notifications/NotificationService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net.Mail; using System.Threading; using System.Threading.Tasks; using AsbCloudApp.Data; @@ -60,7 +61,15 @@ public class NotificationService var notificationTransportService = GetTransportService(request.IdTransportType); - await notificationTransportService.SendAsync(notification, cancellationToken); + //todo Добавить задачу в WorkToSendEmail + try + { + await notificationTransportService.SendAsync(notification, cancellationToken); + } + catch (SmtpException ex) + { + Console.WriteLine(ex.Message); + } notification.SentDate = DateTime.UtcNow; await notificationRepository.UpdateAsync(notification, cancellationToken);