title: Access system.net settings from app.config programmatically in C#
body: <p>I am trying to programmatically access a Windows application app.config file. In particular, I am trying to access the "system.net/mailSettings"
  The following code </p>
  
  <pre><code>Configuration config = ConfigurationManager.OpenExeConfiguration(configFileName);
  
  MailSettingsSectionGroup settings = 
      (MailSettingsSectionGroup)config.GetSectionGroup(@"system.net/mailSettings");
  
  Console.WriteLine(settings.Smtp.DeliveryMethod.ToString());
  
  Console.WriteLine("host: " + settings.Smtp.Network.Host + "");
  Console.WriteLine("port: " + settings.Smtp.Network.Port + "");
  Console.WriteLine("Username: " + settings.Smtp.Network.UserName + "");
  Console.WriteLine("Password: " + settings.Smtp.Network.Password + "");
  Console.WriteLine("from: " + settings.Smtp.From + "");
  </code></pre>
  
  <p>fails to give the host, from. it only gets the port number. The rest are null;  </p>