所以我有一個列表框,顯示電子郵件的主題(我使用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