title: Show Email body in textbox from listbox Imap/pop3
body: <p>So I have a listbox that shows the subject of an email (I use the chilkat imap client) when I select the subject of an email I want to show the message body in a textbox but i cant figure out how to do it, obviusly i use the listbox selectindexchanaged event but how would i go about it</p>
  
  <p>Code So Far</p>
  
  <pre><code>// Create an object, connect to the IMAP server, login,
          // and select a mailbox.
          Chilkat.Imap imap = new Chilkat.Imap();
          imap.UnlockComponent("UnlockCode");
          imap.Connect("Imap URL");
          imap.Login("email address", "password");
          imap.SelectMailbox("Inbox");
  
          // Get a message set containing all the message IDs
          // in the selected mailbox.
          Chilkat.MessageSet msgSet;
          msgSet = imap.Search("ALL", true);
  
          // Fetch all the mail into a bundle object.
          Chilkat.EmailBundle bundle = new Chilkat.EmailBundle();
          bundle = imap.FetchBundle(msgSet);
  
          // Loop over the bundle and display the From and Subject.
          Chilkat.Email email;
          int i;
          for (i = 0; i &lt; bundle.MessageCount - 1; i++)
          {
  
              email = bundle.GetEmail(i);
              listBox1.Items.Add(email.From + ": " + email.Subject);
              textBox1.Text = email.Body ;
  
          }
  
          // Save the email to an XML file
          bundle.SaveXml("bundle.xml");
  
  
  
          // Disconnect from the IMAP server.
          // This example leaves the email on the IMAP server.
          imap.Disconnect();
      }
  }
  </code></pre>
  
  <p>thanks in advance</p>