We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Download emails from Office 365

Hi there,

We have a requirement to download any new emails from a mailbox which is in office 365. I see that Aspose.Email product can help us to connect to Office 365 outlook and access the mailbox.

I was wondering if you can provide me code which connects to office 365 mailbox and access the Inbox folder to download any new emails?

Thank you,

Hello, @sanjaybk,

Here is a project EWSModernAuthenticationApp.zip (3.0 KB) of a simple app which connects to Office365 and gets the list of messages. To run the app you should just fill your access parameters in the appsettings.json file. Note that to get new messages in the Inbox folder we use ExchangeQueryBuilder and InternalDate.Since() method. The date of the last visit should be passed to this method as a parameter. In this way we search for new messages.

Thank you.