Example #1
0
 public static SmtpClient MapTo(SmtpConfig config)
 {
     var client = new SmtpClient
     {
         Port = config.Port,
         DeliveryMethod = config.DeliveryMethod,
         UseDefaultCredentials = config.UseDefaultCredentials,
         Host = config.Host,
         Credentials = new System.Net.NetworkCredential(config.Sender.Email, config.Sender.Password)
     };
     return client;
 }
Example #2
0
 public SmtpEmailSender(SmtpConfig config)
 {
     _client = SmtpMapping.MapTo(config);
 }