/// <inheritdoc/> public async Task <SendResponse> SendEmailAsync(EmailMessage message) { message.ThrowIfNull(nameof(message)); IFluentEmail email = fluentEmail .SetFrom(message.From.Address, message.From.DisplayName) .Subject(message.Subject) .Body(message.Message); message.To?.ForEach(to => email.To(to)); message.Сс?.ForEach(cc => email.CC(cc)); email.Data.IsHtml = true; logger.LogInformation($"Sending email with title \"{message.Subject}\" asynchronously"); return(await Policy .Handle <Exception>() .WaitAndRetryForeverAsync(GetSleepTimeForRetry, LogRetryException) .ExecuteAsync(() => email.SendAsync())); }