/// <summary> /// Initializes a new instance of the <see cref="MailSender"/> class. /// </summary> /// <param name="configurationSectionName">Name of the configuration section in the configuration file.</param> public MailSender(string configurationSectionName = "MailSenderSettings") { if (string.IsNullOrEmpty(configurationSectionName)) { throw new ArgumentNullException("configurationSectionName"); } Settings = new MailSenderSettings(configurationSectionName); }
/// <summary> /// Initializes a new instance of the <see cref="MailSender"/> class. /// </summary> /// <param name="smtpServerAddress">The SMTP server address.</param> /// <param name="smtpServerPortNumber">The SMTP server port number.</param> /// <param name="smtpUserName">Name of the SMTP user.</param> /// <param name="smtpUserPassword">The SMTP user password.</param> /// <param name="enableSsl">Enables SSL connection.</param> /// <param name="antiSpamMessagesPoolOn">Enables anti-spam messages pool.</param> /// <param name="antiSpamPoolMessageLifeTime">The anti-spam pool message life time.</param> public MailSender(string smtpServerAddress, int smtpServerPortNumber, string smtpUserName, string smtpUserPassword, bool enableSsl = false, bool antiSpamMessagesPoolOn = true, int antiSpamPoolMessageLifeTime = 125) { if (string.IsNullOrEmpty(smtpServerAddress)) { throw new ArgumentNullException("smtpServerAddress"); } Settings = new MailSenderSettings(smtpServerAddress, smtpServerPortNumber, smtpUserName, smtpUserPassword, enableSsl, antiSpamMessagesPoolOn, antiSpamPoolMessageLifeTime); }
/// <summary> /// Initializes a new instance of the <see cref="MailSender"/> class. /// </summary> /// <param name="configurationSectionName">Name of the configuration section in the configuration file.</param> public MailSender(string configurationSectionName = "MailSenderSettings") { Settings = new MailSenderSettings(configurationSectionName); }