title: Setting up SMTP loally without username, password
body: <p>I am trying to setup SMTP relay to send mails from the web application without username and password.  I read that you can setup locally on your IIS and use "No Authentication"   <a href="https://i.stack.imgur.com/5hajS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5hajS.png" alt="enter image description here"></a>
  In web.config, these are my settings:</p>
  
  <pre><code>&lt;appSettings&gt;
    &lt;add key="SmtpServerAddress" value="localhost" /&gt;
    &lt;add key="SmtpServerPort" value="25" /&gt;
    &lt;add key="SmtpServerTimeout" value="30" /&gt;
  &lt;/appSettings&gt;
  &lt;system.net&gt;
  &lt;mailSettings&gt;
    &lt;smtp deliveryMethod="Network" from=""&gt;
      &lt;network host="localhost" port="25" /&gt;
    &lt;/smtp&gt;
  &lt;/mailSettings&gt;
  </code></pre>
  
  <p>  </p>
  
  <p>And my code-behind to send email is :</p>
  
  <pre><code> SmtpClient sc = new SmtpClient();
      sc.Host = "localhost";
      sc.Port = 25;
     sc.UseDefaultCredentials = true;
   sc.DeliveryMethod = SmtpDeliveryMethod.Network;
   try
     {
       sc.Send(mm);
     }
   catch (Exception ex)
     {
       throw ex;
     }
  </code></pre>
  
  <p>When I submit the click event, to send mail, I am getting "remote server not found".  </p>
  
  <p>Could you shed some light on this ?</p>