1
votes

Is there a method or any way to receive or get new emails from the server for the Lotus Notes Domino object in C sharp?

When looping through the Inbox view all I get is existing emails and not new emails. So I am trying to initiate a receive.

2

2 Answers

1
votes

"Unread marks" or "Unread email" is a unique function to Lotus Notes that is not exposed as an API in Java or .Net. But you can programmatically emulate it without too much complexity. Is it possible for you to try this:

If your CSharp object can have a "last Checked" date/time value that is set when you traverse the inbox.

Now whilst looping through the inbox, get the created date of each document.

In the case of email in a Lotus Notes database, this is the date the email hit the account. So it should be a fairly reliable means of determining the arrival date of the email.

The created date property is under the NotesDocument object as "created". This should return a date/time value that you can use. Any document that is newer than the "last checked" value would therefore be new mail.

If you have a particularly large inbox to loop through, you can get the inbox object (which can be treated like a view), and also use "GetAllUnreadEntries" method on the NotesView object.

Links to example code is in links above.

0
votes

If you're running into a situation where new emails are added to the view you are looping through after you've started looping, then you can call the NotesView.Refresh method to update the NotesView object.

Otherwise the NotesView object will contain all the emails in the view. If by "new" you're talking about unread emails, that's a different story. Notes 8.0 introduces a method called GetAllUnreadEntries which would help you navigate through any unread view entries. The backend document itself doesn't store a read/unread property.

Hope this helps!