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);