title: C#. POP3 Client using WebClient or HttpClient
body: <p>I try to receive messages from mailbox. I found how to do this using tcp client:</p>
  
  <pre><code>static void Receive()
  {
      using (TcpClient client = new TcpClient ("mail.isp.com ", 110))
      using (NetworkStream n = client.GetStream())
      {
          ReadLine (n);                             // Read the welcome message.
          SendCommand (n, "USER username");
          SendCommand (n, "PASS password");
          SendCommand (n, "LIST");                  // Retrieve message IDs
          List&lt;int&gt; messageIDs = new List&lt;int&gt;();
          while (true)
          {
              string line = ReadLine (n);             // e.g.  "1 1876"
              if (line == ".") break;
              messageIDs.Add (int.Parse (line.Split (' ')[0] ));   // Message ID
          }
  
          foreach (int id in messageIDs)         // Retrieve each message.
          {
              SendCommand (n, "RETR " + id);
              string randomFile = Guid.NewGuid().ToString() + ".eml";
              using (StreamWriter writer = File.CreateText (randomFile))
              while (true)
              {
                  string line = ReadLine (n);      // Read next line of message.
                  if (line == ".") break;          // Single dot = end of message.
                  if (line == "..") line = ".";    // "Escape out" double dot.
                  writer.WriteLine (line);         // Write to output file.
              }
              SendCommand (n, "DELE " + id);       // Delete message off server.
          }
          SendCommand (n, "QUIT");
      }
  }
  </code></pre>
  
  <p>How can I receive mail using web request?<br>
  I need to do this using http client.<br>
  Thank you!</p>