title: How does my ASP.NET app get the SMTP settings automatically from web.config?
body: <p>I noticed that we always just are like:</p>
  
  <pre><code>SmtpClient mSmtpClient = new SmtpClient();
  // Send the mail message
  mSmtpClient.Send(mMailMessage);
  </code></pre>
  
  <p>And the only place the credentials are set are in web.config:</p>
  
  <pre><code>  &lt;system.net&gt;
      &lt;mailSettings&gt;
        &lt;smtp&gt;
          &lt;network host="xxx.xx.xxx.229" userName="xxxxxxxx" password="xxxxxxxx"/&gt;
        &lt;/smtp&gt;
      &lt;/mailSettings&gt;
    &lt;/system.net&gt;
  </code></pre>
  
  <p>So my question is, how does it automagically get them out?</p>