title: C# : SMTP error
body: <p>i am creating an email client that sends e-mail address from server ip instead of SMTP , i wrote the following code:</p>
  
  <pre><code>SmtpClient server = new SmtpClient();
  server.Host= "50.23.128.66";
  server.Port = 25;
  server.Send("from@yahoo.com", "to@yahoo.com", "hi", "hope it works");
  </code></pre>
  
  <p>but when i run it, i get that error:</p>
  
  <blockquote>
    <p>Unhandled Exception: System.Net.Mail.SmtpException: Service not
    available, closing transmission channel. The server response was:
    Cannot connect to SMTP server
    50.23.128.66 (50.23.128.66:25), connect error 10061</p>
  </blockquote>
  
  <p>i actually think that port is wrong . <strong>* By the way i am using Windows Server 2008 *</strong></p>