mailsettings

SMTP Authentication with config file's MailSettings

蓝咒 提交于 2019-12-18 14:16:09
问题 I'm storing my MailSettings in a web.config, however when I send the message, my SMTP server reports back that I need to use authentication. I've got my username/password in the config file, but it still fails. It works if I do the following, but it seems like an extra step. Shouldn't it just take it from the config file and use authentication automatically? System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration( HttpContext.Current.Request.ApplicationPath);

SMTP Authentication with config file's MailSettings

时光怂恿深爱的人放手 提交于 2019-11-30 11:16:06
I'm storing my MailSettings in a web.config, however when I send the message, my SMTP server reports back that I need to use authentication. I've got my username/password in the config file, but it still fails. It works if I do the following, but it seems like an extra step. Shouldn't it just take it from the config file and use authentication automatically? System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration( HttpContext.Current.Request.ApplicationPath); MailSettingsSectionGroup settings = (MailSettingsSectionGroup) config.GetSectionGroup("system.net

Setting multiple SMTP settings in web.config?

≡放荡痞女 提交于 2019-11-27 06:40:53
I am building an app that needs to dynamically/programatically know of and use different SMTP settings when sending email. I'm used to using the system.net/mailSettings approach, but as I understand it, that only allows one SMTP connection definition at a time, used by SmtpClient(). However, I need more of a connectionStrings-like approach, where I can pull a set of settings based on a key/name. Any recommendations? I'm open to skipping the tradintional SmtpClient/mailSettings approach, and I think will have to... I needed to have different smtp configurations in the web.config depending on

Setting multiple SMTP settings in web.config?

偶尔善良 提交于 2019-11-26 12:06:41
问题 I am building an app that needs to dynamically/programatically know of and use different SMTP settings when sending email. I\'m used to using the system.net/mailSettings approach, but as I understand it, that only allows one SMTP connection definition at a time, used by SmtpClient(). However, I need more of a connectionStrings-like approach, where I can pull a set of settings based on a key/name. Any recommendations? I\'m open to skipping the tradintional SmtpClient/mailSettings approach, and