arclms18
  • arclms18
  • 51.5% (Neutral)
  • Newbie Topic Starter
7 years ago
i tried to register the idle event hoping to receive a notification, but did not get any. Here is my code... what am i missing?
Do we have any samples?

MailServer oServer = new MailServer(_config.EmailServer, _config.EmailAccountName, _config.EmailAccountPasswrod, ServerProtocol.Imap4);
my windows service has this code to register for event:

MailClient oClient = new MailClient(_config.EaGetMailLicense);
oServer.SSLConnection = true;
oServer.Port = 993;
oClient.Connect(oServer);
oClient.OnIdle += new MailClient.OnIdleEventHandler(NewMessageReceived);


public void NewMessageReceived(object source, ref bool cancel)
{
// Do something with the source...
_logger.InfoFormat($"New {_config.ConfigurationName} Message notification: {source.ToString()}");
//ProcessMessages();

}
ivan
  • ivan
  • 100% (Exalted)
  • Administration
7 years ago
Hi, OnIdle is not used for new email notification, to wait for new email, please use this method:

https://www.emailarchitect.net/eagetmail/sdk/?ct=mailclient_waitnewemail 
arclms18
  • arclms18
  • 51.5% (Neutral)
  • Newbie Topic Starter
7 years ago
Ivan ,
Thanks for your response.
How does the mailclient.WaitNewEmail(100) work? The documentation is not clear on whether it is using a polling or using IDLE command to get notification from server. if I use -1 to wait indefinitely I get issues with connection errors etc...





ivan
  • ivan
  • 100% (Exalted)
  • Administration
7 years ago
It uses IDLE for IMAP4, URL notification for EWS, if it is -1, yes, it means Infinite.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.