using System.Configuration;
using System.Web.Configuration;
using System.Net.Configuration;
String path = Request.CurrentExecutionFilePath;
path = path.Substring(0, path.LastIndexOf('/'));
Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration(path);
MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
if (mailSettings != null)
{
iPort = mailSettings.Smtp.Network.Port;
strHost = mailSettings.Smtp.Network.Host;
strPassword = mailSettings.Smtp.Network.Password;
strUserName = mailSettings.Smtp.Network.UserName;
}
Hiç yorum yok:
Yorum Gönder