This is my web.config
mail settings:
It is not necessary to use the ConfigurationManager
and get the values manually. Simply instantiating an SmtpClient
is sufficient.
SmtpClient client = new SmtpClient();
This is what MSDN says:
This constructor initializes the Host, Credentials, and Port properties for the new SmtpClient by using the settings in the application or machine configuration files.
Scott Guthrie wrote a small post on that some time ago.