aspdotnetuser
Programmer
Hi,
I am replacing all System.Web.Mail code with System.Net.Mail - everything works ok when I specify the host and port in the same code block as the email details, but if I want it to refer to the System.Net settings in web.config what do I need to replace the following line of code with?
[blue]SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["SmtpServer"].ToString();[/blue]
I am replacing all System.Web.Mail code with System.Net.Mail - everything works ok when I specify the host and port in the same code block as the email details, but if I want it to refer to the System.Net settings in web.config what do I need to replace the following line of code with?
[blue]SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["SmtpServer"].ToString();[/blue]