There's a lot to understand and correct in your code. First, it may be instructive for you to read the InputStream from the HttpURLConnection after you send your data. HTTP is a request-response protocol, so reading the response is fulfilling part of the contract, not to mention you may get useful information, like error messages, from the response.
Second, you are sending a lot of unnecessary information. The format of an input field on an HTML page (i.e. <input type=hidden name="subject" value="Your Subject"> ) contains a lot of information about how to display (or not to display) fields to the user. This information does not get passed back in the POST request. Only a series of name-value pairs get passed back (i.e. subject=Your Subject). The name-value pairs are seperated by '&'. Have a look at
this example from the Java Almanac.
Third, note in the above example that the value part of the name-value pairs can contain characters which are recognized as HTTP control characters (i.e. space, '=' and so on), so they need to be encoded using URLEncoder.
Those changes should get you a little closer to your goal.