How to read the body of the message in the mail retrieve from gmail by using pop3 in c #?
<p>This is code:</p>

<pre><code>protected void Button9_Click(object sender, EventArgs e)
</code></pre>

<p>{
   try
   { 
     // create an instance of TcpClient</p>

<pre><code>    TcpClient tcpclient = new TcpClient();    

 // HOST NAME POP SERVER and gmail uses port number 995 for POP

     tcpclient.Connect("pop.gmail.com", 995);

 // This is Secure Stream // opened the connection between client and POP Server

    System.Net.Security.SslStream sslstream = new SslStream(tcpclient.GetStream());

 // authenticate as client  

       sslstream.AuthenticateAsClient("pop.gmail.com");

 //bool flag = sslstream.IsAuthenticated;   // check flag

// Asssigned the writer to stream 

   System.IO.StreamWriter sw = new StreamWriter(sslstream);

 // Assigned reader to stream

   System.IO.StreamReader reader = new StreamReader(sslstream);

// refer POP rfc command, there very few around 6-9 command

  sw.WriteLine("USER your_gmail_user_name@gmail.com");

// sent to server
  sw.Flush();       sw.WriteLine("PASS your_gmail_password");

  sw.Flush();

  // RETR 1 will retrive your first email. it will read content of your first email

   sw.WriteLine("RETR 1");

   sw.Flush();
 // close the connection
   sw.WriteLine("Quit ");
   sw.Flush();        string str = string.Empty;
   string strTemp = string.Empty;
   while ((strTemp = reader.ReadLine()) != null)
  {
      // find the . character in line
    if (strTemp == ".")
    {
       break;
     }
    if (strTemp.IndexOf("-ERR") != -1)
    {
       break;
     }
    str += strTemp;
  }

 textbox1.text=str;
 textbox1.text+="&lt;BR&gt;" + "Congratulation.. ....!!! You read your first gmail email ";
}

 catch (Exception ex) 
{
    Response.Write(ex.Message);
}
</code></pre>

<p>}</p>

<p>The message body is a bunch of what appears to be random characters. I know it's not just a bunch of random characters but some code that needs to be parsed and converted. How can I read content in "message body"?</p>
