-
-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added FAQ about using shared mailboxes with Office365
Improves docs for issue #1770
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
* [Why doesn't ImapFolder.MoveTo() move the message out of the source folder?](#imap-move-does-not-move) | ||
* [How can I mark messages as read using IMAP?](#imap-mark-as-read) | ||
* [How can I re-synchronize the cache for an IMAP folder?](#imap-folder-resync) | ||
* [How can I login using a shared mailbox in Office365?](#office365-shared-mailboxes) | ||
|
||
### SmtpClient | ||
|
||
|
@@ -1731,6 +1732,31 @@ static void ResyncFolder (ImapFolder folder, List<CachedMessageInfo> cache, ref | |
} | ||
``` | ||
|
||
### <a href="office365-shared-mailboxes">Q: How can I login using a shared mailbox in Office365?</a> | ||
|
||
```csharp | ||
var result = await GetPublicClientOAuth2CredentialsAsync ("IMAP", "[email protected]"); | ||
|
||
// Note: We always use result.Account.Username instead of `Username` because the user may have selected an alternative account. | ||
var oauth2 = new SaslMechanismOAuth2 (result.Account.Username, result.AccessToken); | ||
|
||
using (var client = new ImapClient ()) { | ||
await client.ConnectAsync ("outlook.office365.com", 993, SecureSocketOptions.SslOnConnect); | ||
await client.AuthenticateAsync (oauth2); | ||
|
||
// ... | ||
await client.DisconnectAsync (true); | ||
} | ||
``` | ||
|
||
Notes: | ||
|
||
1. The `GetPublicClientOAuth2CredentialsAsync()` method used in this example code snippet can be found in the | ||
[ExchangeOAuth2.md](ExchangeOAuth2.md#desktop-and-mobile-applications) documentation. | ||
2. Some users have reported that they need to use `"[email protected]\\sharedMailboxName"` as their | ||
username instead of `"[email protected]"`. | ||
|
||
## SmtpClient | ||
|
||
### <a id="smtp-sent-folder">Q: Why doesn't the message show up in the "Sent Mail" folder after sending it?</a> | ||
|