Open benfoster opened 11 years ago
I'm keeping our ImapClient alive and polling periodically for new messages with the following code:
ImapClient
public IEnumerable<Message> GetMessages() { foreach (var msgId in client.Search(SearchCondition.Unseen())) { var msg = client.GetMessage(msgId, headersonly: false, setseen: true); foreach (var attachment in msg.Attachments) { yield return new Message { ContentType = attachment.ContentType, Filename = attachment.Filename, Data = attachment.GetData() }; } } }
I'm finding that any new emails are not returned. Do I need disconnect/reconnect between polling in order to pick new mail/clear the queue?
I'm keeping our
ImapClient
alive and polling periodically for new messages with the following code:I'm finding that any new emails are not returned. Do I need disconnect/reconnect between polling in order to pick new mail/clear the queue?