SMTP Authentication with config file's MailSettings
问题 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);