title: Accessing SMTP Mail Settings from Web.Config File by using c#
body: <p>Need to read my SMTP email settings defined under system.net section in my web.config file. </p>
  
  <p>Below is one example of SMTP email setting defined in web.config file:
  (Under  Section)</p>
  
  <pre><code>&lt;system.net&gt;
  &lt;mailSettings&gt;
  &lt;smtp deliveryMethod="Network" from="testuser@domail.com"&gt;
  &lt;network defaultCredentials="true" host="localhost" port="25" userName="user” password="testPassword"/&gt;
  &lt;/smtp&gt;
  &lt;/mailSettings&gt;
  &lt;/system.net&gt;
  </code></pre>
  
  <p>How to Access the SMTP Mail Setting by using c#</p>