private async Task SendEmailShedullerAsync() { var messages = GetMessages(); try { MyMessageQueue.Enqueue($"Письмо будет отправлено {SendDate.ToShortDateString()} в {SendTime.ToShortTimeString()}"); await Task.Run(() => _mesageSendService.SendEmailScheduler( SmtpServer, messages, SendDate, SendTime)); } catch (EmailSendServiceException ex) { MyMessageQueue.Enqueue(ex.Message); } }
public override string ToString() { return($"{SendDate.ToShortDateString()} {SendDate.ToShortTimeString()} || {Subject} || From {SenderId}"); }