예제 #1
0
        protected virtual SmtpClient GetSMTPClient(SMTPConfig config)
        {
            SmtpClient client = new SmtpClient(config.Host, config.Port);

            client.EnableSsl             = true;
            client.UseDefaultCredentials = false;
            client.Credentials           = new NetworkCredential(config.Username, config.Password);
            return(client);
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="config"></param>
 /// <param name="parser"></param>
 public SMTPService(SMTPConfig config, INotificationBodyParser parser = null) : base(parser)
 {
     this._config = config;
     this._client = this.GetSMTPClient(this._config);
 }