所以我有一个列表框,显示电子邮件的主题(我使用chilkat imap客户端)当我选择电子邮件的主题我想显示邮件正文在一个文本框,但我无法弄清楚如何做到这一点,obviusly我使用列表框selectindexchanaged事件,但如何将我去一下从列表框中显示电子邮件正文在文本框Imap/pop3
到目前为止的代码
// 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 < 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();
}
}
在此先感谢
仍然不能得到任何其他想法的任何其他想法做任何我想要的 – Shane121 2010-09-10 17:59:49