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); }
public MailServiceTests() { configuration = new EmailConfigurations() { FromAddress = "*****@*****.**", SmtpServer = "smtp.gmail.com", Port = 465, Username = "******", Password = "******", IsRequireSsl = false }; message = new MessageDto() { From = "*****@*****.**", To = "*****@*****.**", Subject = "Test Email Notifaction", Body = "Email Contents" }; }
public EmailSender(EmailConfigurations config) { this.config = config; }
public EmailConfiguration Get() { return(EmailConfigurations.FirstOrDefault()); }