示例#1
0
        private SmtpClient parseSmtpClient(MailConfig config)
        {
            SmtpClient smtpClient = new SmtpClient();

            if (!string.IsNullOrEmpty(config.Username))
            {
                smtpClient.Credentials = new NetworkCredential(config.Username, config.Password);
            }
            smtpClient.Host    = config.Host;
            smtpClient.Port    = config.Port;
            smtpClient.Timeout = config.Timeout;
            return(smtpClient);
        }
示例#2
0
 public MailSender(MailConfig config)
 {
     this.config = config;
 }
示例#3
0
 public DefaultMailSender(MailConfig config) : base(config)
 {
 }