In this article I will explain with an example, how to configure Email SMTP Settings in App.Config file in Windows Forms (WinForms) Application.
Email SMTP Settings in App.Config file
Following are the Mail Server settings added in the App.Config file.
The SMTP Mail settings are stored in the appSettings sub-section of the configuration section of the App.Config file.
<configuration>
<appSettings>
<add key="Host" value="smtp.gmail.com" />
<add key="Port" value="587" />
<add key="EnableSsl" value="True" />
<add key="UserName" value="sender@gmail.com" />
<add key="Password" value="SenderGmailPassword" />
<add key="DefaultCredentials" value="True" />
</appSettings>
</configuration>
For more details on how to send Email, please refer following article.