title: `500 Command not understood.` from windows IIS FTP server on sending USER command using Java
body: <p>This is my first time writing a standardized protocol client so please bear with me.</p>
  
  <p>I'm trying to send a USER command to an ftp server but I keep getting <code>500 Command not understood.</code> as a response.</p>
  
  <p>Here's my send function:</p>
  
  <pre><code>private static String SendToServer(PrintWriter server_output, BufferedReader server_input, String message)
  {
      String server_response = null;
      try {
          server_output.println(message);
          server_response = server_input.readLine();
          if (server_response == null) {
              System.err.println("Error #2: Lost connection");
              return "";
          }
      }
      catch (IOException e)
      {
          System.err.println("Error #9999: Unexpected exception: "+ e.getMessage());
      }
      System.out.println("# " + server_response);
  
      return server_response.toString();
  }
  </code></pre>
  
  <p>Here's how I call the functions:</p>
  
  <pre><code>SendToServer(server_out, server_in, ""); //An empty command tries to establish a connection
  SendToServer(server_out, server_in, "USER anonymous"); //Tries to "log in" anonymously
  </code></pre>
  
  <p>And here's the output:</p>
  
  <pre><code># 220 Microsoft FTP Service
  # 500 Command not understood.
  </code></pre>
  
  <p>The question is: Why am I getting a <code>500 Command not understood.</code> response?</p>
  
  <p>EDIT: I'm doing a University assignment so as much as I want to, I cannot use any existing ftp libraries</p>