Example #1
0
        public void Save(CreateOrEditParameters parameters)
        {
            var configuration = EmailConfigurations.FirstOrDefault();

            if (configuration == null)
            {
                configuration = new EmailConfiguration();
                UpdateConfiguration(configuration, parameters);
                EmailConfigurations.Put(configuration);
            }
            else
            {
                UpdateConfiguration(configuration, parameters);
            }
            var emailServerConfiguration = new EmailServerConfiguration();

            emailServerConfiguration.Port      = configuration.Port;
            emailServerConfiguration.EnableSsl = configuration.EnableSsl;
            emailServerConfiguration.User      = configuration.HostUser;
            emailServerConfiguration.Password  = configuration.Password;
            emailServerConfiguration.Host      = configuration.Host;
            emailServerConfiguration.From      = configuration.FromEmail;

            EmailService.Reset(emailServerConfiguration);
        }
Example #2
0
 public EmailConfiguration Get()
 {
     return(EmailConfigurations.FirstOrDefault());
 }