public EmailGatewaySettings(ConfigInfoBase config = null, IValidatorT <string> allowedFilter = null) { // No need to manually get GetMailSettings MailSettingsSectionGroup in .NET Framework. That is automatic. // https://hassantariqblog.wordpress.com/2017/03/20/asp-net-core-sending-email-with-gmail-account-using-asp-net-core-services/ var app = ConfigApp._Instance.Value; if (config == null) { config = app.ConfigInfo; } AllowedFilter = config.IsEnvironModeProd() ? null : allowedFilter; // Can we send email to anybody ? ignore white list in prod mode. // Search for email config in AppSettings.json for .NET Core. if (config.GetSetting(ConfigInfoBase.kSmtp + "Host") != null) { Init(config); } }
public EmailGateway(ConfigInfoBase config, IValidatorT <string> allowedFilter) { Settings = new EmailGatewaySettings(config, allowedFilter); }