public static void FromConnectionString(this SmtpHealthCheckOptions setup, string cs) { var c = new SmtpConnectionBuilder(cs); setup.Host = c.Server; setup.Port = c.Port; setup.ConnectionType = c.UseSsl ? SmtpConnectionType.TLS : SmtpConnectionType.PLAIN; if (c.Username != null) { setup.LoginWith(c.Username, c.Password); } }
private static SmtpHealthCheckOptions Options(EmailServerSettings settings) { var option = new SmtpHealthCheckOptions { Host = settings.Host, Port = settings.Port, ConnectionType = SmtpConnectionType.AUTO, }; option.LoginWith(settings.UserName, settings.Password); return(option); }