Пример #1
0
 /// <exception cref="ArgumentException" />
 /// <exception cref="ArgumentOutOfRangeException" />
 public SmtpConnectionChecker(SmtpConnectionSettings settings)
 {
     if (String.IsNullOrEmpty(settings.Server))
     {
         throw new ArgumentException("Server can't be empty", nameof(settings));
     }
     if (settings.Port <= 0 || settings.Port > 65535)
     {
         throw new ArgumentOutOfRangeException(nameof(settings), "Port should be between 0 and 65536 ");
     }
     _settings = settings;
 }
Пример #2
0
 public SmtpMailSender(SmtpConnectionSettings settings, ILogger logger)
 {
     _settings = settings;
     _logger   = logger;
 }