Accessing Config File Mail Settings Programmatically

Accessing Config File Mail Settings Programmatically

NET 2.0 provides APIs for accessing everything in a configuration file. For accessing the mail settings programatically use the following code.

System.Net.Configuration.MailSettingsSectionGroup mMailSettings;

int mPort = mMailSettings.Smtp.Network.Port;
string mHost = mMailSettings.Smtp.Network.Host;
string mPassword = mMailSettings.Smtp.Network.Password;
string mUsername = mMailSettings.Smtp.Network.Username;

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.