|You shouldn't need any of that code. The
SmtpClient will initialize itself based on the settings in the
web.config file automatically.
The SmtpClient constructor[^] calls the Initialize method[^], which reads the settings from the config file.
If it's not working, then you need to debug your code to see what settings are actually being read from your config file.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."