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; }
public SmtpEmailSender(SmtpConfig config) { _client = SmtpMapping.MapTo(config); }