public async Task SendMailAsync(EmailMessage message)
        {
            var configuration = await _configurationManager.GetConfigAsync();

            if (configuration == null)
            {
                return;
            }
            using (var client = new SmtpClient(configuration.Host, configuration.Port !.Value))
            {
                client.EnableSsl = configuration.UseSsl;
                if (!string.IsNullOrEmpty(configuration.Username))
                {
                    client.Credentials = new NetworkCredential(configuration.Username, configuration.Password);
                }
                await client.SendMailAsync(ConvertMessage(message));
            }
        }
        public async Task <IActionResult> OnGet()
        {
            var appointmentConfig = await _appointmentConfigManager.GetConfigAsync();

            AvailableIntervalStart = FormatDate(appointmentConfig.AvailableIntervalStart);
            AvailableIntervalEnd   = FormatDate(appointmentConfig.AvailableIntervalEnd);
            var emailConfig = await _emailConfigurationManager.GetConfigAsync();

            Host     = emailConfig.Host;
            Port     = emailConfig.Port;
            UseSsl   = emailConfig.UseSsl;
            Username = emailConfig.Username;
            Password = emailConfig.Password;
            var messageTemplate = await _service.FindTempalateByNameAsync("AppointmentAcceptedMessage");

            AppointmentAcceptedMessageFromTemplate    = messageTemplate?.FromTemplate;
            AppointmentAcceptedMessageSubjectTemplate = messageTemplate?.SubjectTemplate;
            AppointmentAcceptedMessageBodyTemplate    = messageTemplate?.BodyTemplate;
            return(Page());
        }