check unread emails?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishal1082
    New Member
    • Apr 2009
    • 92

    #16
    THE SOLUTION!

    Code:
                        l.Login(server, user, pass, ssl);
                        l.SelectFolder("INBOX"); 
                        System.Collections.ArrayList list = new System.Collections.ArrayList();
                        int mails = 0;
                        try { l.SearchMessage(new string[] { "unseen" }, false, list); }
                        catch{}
                        mails = list.Count - 1;
                        l.LogOut();
                        return mails;
    i edited the 2nd lib so i can give it a string as folder name, and VOILA! works like a charm!! wohoo!!, only problem is with non-SSL mails that when there is no unread mails it gives error thats why i have the try catch around search message

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #17
      Congratulations ! A little determination, a little help from others, a LOT of trial and error. Feels good, huh?

      Comment

      • vishal1082
        New Member
        • Apr 2009
        • 92

        #18
        YEUP! thanks people!

        Comment

        Working...