+1 vote

I have a requirement to monitor email inbox and i only have a host like 'xyz-com.mail.protection.outlook.com' and most probably a sender email but no password. Is there any possibility to read emails from the inbox based on the above mentioned host. Plz provide me a solution. Thanks in advance.

by

1 Answer

0 votes
 
Best answer

To receive emails using IMAP from a mailbox using C#/.net you need:

1.
A Password - use Imap.UseBestLogin method.

2.
An Application Password.

Turn on Two-step verification for the account, follow the steps described here:
https://support.microsoft.com/en-us/account-billing/5896ed9b-4263-e681-128a-a6f2979a7944
in order to create app password:
Security basics/More security options/App passwords

Use it the same as you would use a regular password (Imap.UseBestLogin).

3.
OAuth 2.0 token received from the user:
https://www.limilabs.com/blog/oauth2-office365-exchange-imap-pop3-smtp

4.
OAuth 2.0 password grant for services/daemons:
https://www.limilabs.com/blog/oauth2-password-grant-office365-exchange-imap-pop3-smtp

5.
If your mailbox is a shared/delegate one:

Shared/delegate mailbox of Exchange Server:
https://www.limilabs.com/blog/access-shared-delegate-mailbox-exchange-server

Shared/delegate mailbox of Office 365:
https://www.limilabs.com/blog/shared-mailbox-office365

by (272k points)
selected by
...