Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: To verify if there are new message... Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
fernandonp
Newbie
Newbie


Joined: 22 June 2009
Location: Brazil
Online Status: Offline
Posts: 3
Posted: 22 June 2009 at 12:40pm | IP Logged Quote fernandonp

I need to know how to verify if there are a new message in my mail box.. Somebody know??
Back to Top View fernandonp's Profile Search for other posts by fernandonp
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 22 June 2009 at 11:13pm | IP Logged Quote Andrew

If you're talking about an IMAP mailbox, your application should connect to the mailbox, select necessary folder (e.g. Inbox), then search for new messages and check number of items in the resulting collection returned by the Search method. You should specify UNSEEN as search condition.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
fernandonp
Newbie
Newbie


Joined: 22 June 2009
Location: Brazil
Online Status: Offline
Posts: 3
Posted: 23 June 2009 at 6:34am | IP Logged Quote fernandonp

Thanks! Worked!

Imap imap = new Imap();   //New object IMAP
imap.Connect("domain", 143); //Conect to domain
imap.Login("login", "psw"); // Login
imap.SelectFolder("Inbox"); // Select the folder
MessageIndexCollection msgs = imap.Search(false, "Unseen", null); // Get the new messages

if (msgs.Count>0)
{
    //if there are new messages to do...     
}

Thnks a lot!
Back to Top View fernandonp's Profile Search for other posts by fernandonp
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide