title: Syntax error, command unrecognized. The server response was ''
body: <p>I've looked at 3 or 4 questions here so far and they haven't helped yet.</p>
  
  <p>I have set up SmarterMail 14.x on a client's machine. I know very little about setting up mail servers (I don't know why he thinks I do) but I have it installed, a domain set up pointing to the MX record, the port open (9998) and I am able to send email just fine from the web interface.</p>
  
  <p>However, I can't send email from Sql or from C#. I created a quick and dirty app to allow me to enter the server, port, credentials, and to/from and I get this response every time:</p>
  
  <blockquote>
    <p>[Inner Exception]
    Unable to connect to the remote server</p>
    
    <p>[Details]
    System.Net.Mail.SmtpException: Failure sending mail. ---> > System.Net.WebException: Unable to connect to the remote server ---> > System.Net.Sockets.SocketException: No connection could be made because the > target machine actively refused it 204.12.49.188:25</p>
  </blockquote>
  
  <p>I've tried multiple logins. I've also confirmed that SMTP is turned on and IMAP/POP3 is turned off. I'd post images of it but unfortunately I can't yet.</p>
  
  <p>The code to send is below and it is about as simple as it gets:</p>
  
  <pre><code>SmtpClient client = new SmtpClient(ServerTextBox.Text, Convert.ToInt32(PortTextBox.Text));
  NetworkCredential login = new NetworkCredential(UsernameTextBox.Text, PasswordTextBox.Text);
  client.Credentials = login;
  
  MailMessage message = new MailMessage(FromTextBox.Text, ToTextBox.Text, "Wine and Spirits Jobs Alerts", "Below are this week's job alerts: There are no job alerts at this time");
  
  client.SendCompleted += HandleSendCompleted;
  client.SendAsync(message, null);
  </code></pre>
  
  <p>I've also tried it locally on their VPS and on my machine. I've turned on and off the firewall and I've got a specific rule allowing outgoing traffic on 9998 (and you can log into the web interface remotely) so this isn't a matter of being able to contact it.</p>
  
  <p>I'm at a loss of what to do. If someone can help??</p>
  
  <p>EDIT: It's clear I was using the wrong port - 9998 instead of 25. Using port 25 now tells me either time out or that it was actively refused. The firewall does have specific rules for port 25 that allow all traffic, so it shouldn't be stopped.</p>
  
  <p>EDIT 2: I've re-created the MX record on the domain and ensured it is pointing to the correct IP address. I've also re-created the domain in Smartermail and made sure SMTP is turned on, authentication is required, SSL is not, POP and IMAP are turned off, and that my login is correct. I've also tried turning on and off the firewall. No dice.</p>