日期:2014-05-17 浏览次数:21054 次
/// <summary>
/// 根据邮件编号返回邮件内容
/// </summary>
/// <param name="uid">邮件编号</param>
/// <returns>成功返回邮件内容,失败返回空字符串</returns>
public string LoadMessage(long uid)
{
try
{
/* NOTE: IMAP_Client_FetchHandler provides events to handle IMAP server returned
* fetch data items for requested message(s).
*/
string html = "";
IMAP_Client_FetchHandler fetchHandler = new IMAP_Client_FetchHandler();
fetchHandler.Rfc822 += new EventHandler<IMAP_Client_Fetch_Rfc822_EArgs>(delegate(object s, IMAP_Client_Fetch_Rfc822_EArgs e)
{
MemoryStream storeStream = new MemoryStream();
e.Stream = storeStream;
e.StoringCompleted += new EventHandler(delegate(object s1, EventArgs e1)
{
storeStream.Position = 0;
Mail_Message mime = Mail_Message.ParseFromStream(storeStream);
//this.tmimin.Tag = mime;
//m_pTabPageMail_MessageAttachments.Tag = mime;
foreach (MIME_Entity entity in mime.Attachments)
{