Get UNSEEN Msg

Nov 22, 2009 at 5:46 AM

In both synchronous and asynchronous method unread msg wont received.

you can use this method

        public List<int> GetUnreadMessageList()
        {
            List<int> MsgUIDs = new List<int>();
            ArrayList sArray = new ArrayList();

            //prep the search string
            string[] strArray = new string[1];
            strArray[0] = "UNSEEN";

            //Make the call to search for unread emails
            SearchMessage(strArray, true, sArray);

            //Count the number of emails matching the search
            foreach (string j in sArray)
            {
                if (!String.IsNullOrEmpty(j) || !j.Equals("\"\"") || !j.Equals(""))
                {
                    try
                    {
                        MsgUIDs.Add(Convert.ToInt32(j));
                    }
                    catch (Exception) { }
                }
            }
            return MsgUIDs;
        }

please update this in your new version...

thank you..

        public List<int> GetUnreadMessageList()
        {
            List<int> MsgUIDs = new List<int>();
            ArrayList sArray = new ArrayList();

            //prep the search string
            string[] strArray = new string[1];
            strArray[0] = "UNSEEN";

            //Make the call to search for unread emails
            SearchMessage(strArray, true, sArray);

            //Count the number of emails matching the search
            foreach (string j in sArray)
            {
                if (!String.IsNullOrEmpty(j) || !j.Equals("\"\"") || !j.Equals(""))
                {
                    try
                    {
                        MsgUIDs.Add(Convert.ToInt32(j));
                    }
                    catch (Exception) { }
                }
            }
            return M
        public List<int> GetUnreadMessageList()
        {
            List<int> MsgUIDs = new List<int>();
            ArrayList sArray = new ArrayList();

            //prep the search string
            string[] strArray = new string[1];
            strArray[0] = "UNSEEN";

            //Make the call to search for unread emails
            SearchMessage(strArray, true, sArray);

            //Count the number of emails matching the search
            foreach (string j in sArray)
            {
                if (!String.IsNullOrEmpty(j) || !j.Equals("\"\"") || !j.Equals(""))
                {
                    try
                    {
                        MsgUIDs.Add(Convert.ToInt32(j));
                    }
                    catch (Exception) { }
                }
            }
            return MsgUIDs;
        }
sgUIDs;
        }