title: Better Way to display emails c# winforms
body: <p>hello i have the following code which lets me display the emails in my inbox on a list view control and display the corrospoding body in a rtb my question is there a better way to handle this data and display it than the  way below im pretty new to c# so detailed answers would be great </p>
  
  <p>p.s im using the chilkat imap component to handle the server side if things
  Thanks In Advance </p>
  
  <pre><code>  Chilkat.MessageSet msgSet = imap.Search("ALL", true);
          bundle = imap.FetchBundle(msgSet);
  
          Chilkat.Email email;
          int i;
          for (i = 0; i &lt; bundle.MessageCount - 0; i++)
          {
              email = bundle.GetEmail(i);
  
              System.Windows.Forms.ListViewItem itmp = new System.Windows.Forms.ListViewItem(email.From);
              System.Windows.Forms.ListViewItem.ListViewSubItem itms1 = new System.Windows.Forms.ListViewItem.ListViewSubItem(itmp, email.Subject);
              System.Windows.Forms.ListViewItem.ListViewSubItem itms2 = new System.Windows.Forms.ListViewItem.ListViewSubItem(itmp, email.FromName);
  
  
              itmp.SubItems.Add(itms1);
              itmp.SubItems.Add(itms2);
  
              listView1.Items.Add(itmp).Tag = i;
  
  
  
              richTextBox1.Text = email.Body;
  
  
  
  
  
          }
  
          // Save the email to an XML file
          bundle.SaveXml("email.xml");
  </code></pre>
  
  <p><em>Updated Code</em></p>
  
  <pre><code> Chilkat.MessageSet msgSet = imap.Search("ALL", true);
          bundle = imap.FetchBundle(msgSet);
  
          Chilkat.Email email;
          int i;
          for (i = 0; i &lt; bundle.MessageCount; i++)
          {
              email = bundle.GetEmail(i);
  
              string[] row = new string[]{email.From,
                                                      email.Subject,email.FromName};
  
  
              object[] rows = new object[] { row };
              foreach (string[] rowArray in rows)
              {
                  listView1.Rows.Add(rowArray);
              }
  </code></pre>