0 votes

We are using Mail.dll .NET mail client for our mail sweep program, we tested it against gmail box and now we are ready to purchase the license.

Instead of using gmail we will be using outlook office 365. We have setup few shared mailboxes. How do I access shared mailboxes, as they don't have assigned password.

by

1 Answer

0 votes

Use the following user format:

Username@DomainName\SharedMailboxAlias

Remember to escape slash \ character.

In case of Office 365 SharedMailboxAlias is a local part (no domain and no ‘@’) of the full email address (“Email address” input on “new shared mailbox” screen).

You must use Login method:

using (Imap client = new Imap)
{
    client.ConnectSSL("outlook.office365.com");

    client.Login(@"Username@DomainName\SharedMailboxAlias", "UserPassword");

    //...

    client.Close();
}

UseBestLogin for Outlook365 uses LoginPLAIN internally (this is the only method Outlook365 claims to support), and this syntax doesn't work for shared mailboxes with LoginPlain.

Alternatively you can use LoginPLAIN to login as a different user:

using (Imap client = new Imap)
{
    client.ConnectSSL("outlook.office365.com");

    client.LoginPLAIN("SharedMailboxAlias", "Username@DomainName", "UserPassword");

    //...

    client.Close();
}

Here you you can find more information about accessing shared mailbox in other Exchange versions.

by (276k points)
...