コード例 #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);
        }
コード例 #2
0
        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"
            };
        }
コード例 #3
0
 public EmailSender(EmailConfigurations config)
 {
     this.config = config;
 }
コード例 #4
0
 public EmailConfiguration Get()
 {
     return(EmailConfigurations.FirstOrDefault());
 }