Beispiel #1
0
 /// <summary>
 ///     Applies connection settings from a connection string using a <see cref="SmtpConnectionStringBuilder"></see>
 /// </summary>
 public static void Configure(this SmtpClient smtpClient,
                              SmtpConnectionStringBuilder smtpConnectionStringBuilder)
 {
     smtpClient.Host        = smtpConnectionStringBuilder.Host;
     smtpClient.Port        = smtpConnectionStringBuilder.Port;
     smtpClient.EnableSsl   = smtpConnectionStringBuilder.EnableSsl;
     smtpClient.Credentials = new NetworkCredential(smtpConnectionStringBuilder.Username,
                                                    smtpConnectionStringBuilder.Password);
 }
Beispiel #2
0
        /// <summary>
        ///     Applies connection settings from a connection string using a <see cref="SmtpConnectionStringBuilder"></see>
        /// </summary>
        public static void Configure(this SmtpClient smtpClient, string connectionString)
        {
            var connectionStringBuilder = new SmtpConnectionStringBuilder(connectionString);

            smtpClient.Configure(connectionStringBuilder);
        }