Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
arclms18  
#1 Posted : Monday, August 27, 2018 10:52:15 AM(UTC)
arclms18

Rank: Newbie

Groups: Registered
Joined: 8/27/2018(UTC)
Posts: 2
United States

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  
#2 Posted : Monday, August 27, 2018 5:26:45 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,153

Thanks: 9 times
Was thanked: 55 time(s) in 55 post(s)
Hi, OnIdle is not used for new email notification, to wait for new email, please use this method:

https://www.emailarchite...=mailclient_waitnewemail
arclms18  
#3 Posted : Tuesday, August 28, 2018 6:00:22 AM(UTC)
arclms18

Rank: Newbie

Groups: Registered
Joined: 8/27/2018(UTC)
Posts: 2
United States

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  
#4 Posted : Tuesday, August 28, 2018 5:02:04 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,153

Thanks: 9 times
Was thanked: 55 time(s) in 55 post(s)
It uses IDLE for IMAP4, URL notification for EWS, if it is -1, yes, it means Infinite.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.076 seconds.

EXPLORE TUTORIALS

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