Пример #1
0
 /// <summary>
 /// Instantiate the <see cref="SmtpProvider"/>
 /// </summary>
 /// <param name="smtpOptions">The SMTP options</param>
 /// <param name="loggerFactory">The logger factory</param>
 public SmtpProvider(IOptions <SmtpProviderOptions> smtpOptions, ILoggerFactory loggerFactory)
     : base(smtpOptions.Value, loggerFactory)
 {
     _smtpClient  = SmtpClient.Create(smtpOptions.Value);
     _smtpOptions = smtpOptions.Value;
 }
Пример #2
0
 /// <summary>
 /// Instantiate the <see cref="SmtpProvider"/>
 /// <para>Please be aware in using this constructor because it was originally intended for testing and it could cause
 /// unwanted behavior if it is used in the real application</para>
 /// </summary>
 /// <param name="smtpOptions">The SMTP options</param>
 /// <param name="smtpClient">The SMTP Client</param>
 /// <param name="loggerFactory">The logger factory</param>
 public SmtpProvider(SmtpProviderOptions smtpOptions, ISmtpClient smtpClient, ILoggerFactory loggerFactory)
     : base(smtpClient.Options, loggerFactory)
 {
     _smtpClient  = smtpClient;
     _smtpOptions = smtpOptions;
 }
Пример #3
0
 /// <summary>
 /// Instantiate the <see cref="SmtpProvider"/>
 /// </summary>
 /// <param name="smtpOptions">The SMTP options</param>
 /// <param name="loggerFactory">The logger factory</param>
 public SmtpProvider(SmtpProviderOptions smtpOptions, ILoggerFactory loggerFactory)
     : base(smtpOptions, loggerFactory)
 {
     _smtpClient  = SmtpClient.Create(smtpOptions);
     _smtpOptions = smtpOptions;
 }