This project is read-only.

Fetch.HeaderObject throws expception

Feb 4, 2011 at 10:08 AM

Hi,

I want to read inbox account using Imap4. I doesn't connect if i use Connect method. It can only be connect with ConnectSsl method.  Once I connect it throws exeption on Fecthing Header object. Can you plz help me in this regard.

Imap4Client imap = new Imap4Client();

            try
            {
                // We connect to the imap4 server
                imap.ConnectSsl("server",port);

                // Login to mail box
                imap.Login("account@gmail.com", "passowrd");

                  Mailbox inbox = imap.SelectMailbox("inbox");
                if (inbox.MessageCount > 0)
                {
                    ActiveUp.Net.Mail.Header header = inbox.Fetch.HeaderObject(1);
                    string subject = header.Subject;                  
                }               
            }

            catch (Imap4Exception iex)
            {       }

            catch (Exception ex)
            {            }

            finally
            {
                if (imap.IsConnected)
                {
                    imap.Disconnect();
                }
            }

ActiveUp.Net.Mail dlls doesn't work with VS2010. Can you please tell me Why?

Hina