TailoredApps.Shared.Email.Office365
2.1.0
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TailoredApps.Shared.Email.Office365 --version 2.1.0
NuGet\Install-Package TailoredApps.Shared.Email.Office365 -Version 2.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TailoredApps.Shared.Email.Office365" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TailoredApps.Shared.Email.Office365" Version="2.1.0" />
<PackageReference Include="TailoredApps.Shared.Email.Office365" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TailoredApps.Shared.Email.Office365 --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TailoredApps.Shared.Email.Office365, 2.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TailoredApps.Shared.Email.Office365@2.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TailoredApps.Shared.Email.Office365&version=2.1.0
#tool nuget:?package=TailoredApps.Shared.Email.Office365&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
TailoredApps.Shared.Email.Office365
An IEmailProvider that reads messages from a Microsoft 365 mailbox over IMAP. It signs in as an application
(OAuth2 client credentials, with a client secret or a certificate), so no user password is stored. The provider
reads mail only; it does not send.
Installation
dotnet add package TailoredApps.Shared.Email.Office365
Registration
using TailoredApps.Shared.Email.Office365;
builder.Services.RegisterOffice365Provider(); // IEmailProvider -> Office365EmailProvider (transient)
Usage
using TailoredApps.Shared.Email;
using TailoredApps.Shared.Email.Models;
public class OrderMailReader(IEmailProvider mailbox)
{
// Messages in Inbox/Orders from the last 24 hours whose sender contains the given text
public Task<ICollection<MailMessage>> ReadLastDay()
=> mailbox.GetMail(folder: "Orders", sender: "orders@partner.example", fromLast: TimeSpan.FromHours(24));
}
Configuration
The Mail:Providers:Office365 section, bound to AuthenticationConfig:
{
"Mail": {
"Providers": {
"Office365": {
"Tenant": "<tenant-id-or-domain>",
"ClientId": "<application-client-id>",
"ClientSecret": "<client-secret>",
"MailBox": "orders@example.com"
}
}
}
}
| Key | Meaning | Default |
|---|---|---|
Tenant |
Tenant id or a domain of the tenant | none |
ClientId |
Application (client) id of the app registration | none |
ClientSecret |
Client secret; used when it is set | none |
Certificate |
A CertificateDescription (Microsoft.Identity.Web); used when there is no client secret |
none |
MailBox |
Address of the mailbox to read | none |
Instance |
Authority format; {0} is replaced with Tenant |
https://login.microsoftonline.com/{0} |
ApiUrl |
Bound, but not used by the provider | https://graph.microsoft.com/ |
Good to know
SendMailis not implemented and throwsNotImplementedException. Send with the SMTP provider fromTailoredApps.Shared.Email. Both providers registerIEmailProvider, so when both are registered a single injectedIEmailProvideris the one registered last.- The provider connects to
outlook.office365.com:993over TLS and requests a token forhttps://outlook.office365.com/.default; neither is configurable. The app registration must be allowed to open the mailbox over IMAP as an application. foldernames a sub-folder of the Inbox; empty means the Inbox itself. The folder is opened read-only.senderandrecipentare "contains" filters,fromLastlimits the search to messages delivered after now minus that time span. With no filters, every message in the folder is downloaded.- Each matching message is downloaded whole. Attachments are decoded and returned as Base64, keyed by file name;
a repeated name gets a
(2)suffix and a part without a name is calledattachment-N. - A missing configuration section throws
InvalidOperationException; with neitherClientSecretnorCertificatethe provider cannot be created; a missingMailBoxthrowsInvalidOperationExceptioninGetMail.
Documentation
https://shared.tailoredapps.pl/en/Libraries/Email/Office365/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- MailKit (>= 4.18.2)
- Microsoft.Identity.Web (>= 4.18.0)
- MimeKit (>= 4.18.2)
- TailoredApps.Shared.Email (>= 2.1.0)
-
net11.0
- MailKit (>= 4.18.2)
- Microsoft.Identity.Web (>= 4.18.0)
- MimeKit (>= 4.18.2)
- TailoredApps.Shared.Email (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-preview.2 | 50 | 11/12/2026 |
| 3.0.0-preview.1 | 67 | 11/12/2026 |
| 2.1.0 | 89 | 11/12/2026 |
| 2.0.1 | 87 | 11/12/2026 |
| 2.0.0 | 107 | 11/12/2026 |
| 1.6.0 | 86 | 11/12/2026 |
| 1.4.19 | 142 | 10/26/2026 |
| 1.4.18 | 152 | 10/23/2026 |
| 1.4.17 | 147 | 10/6/2026 |
| 1.4.16 | 116 | 9/28/2026 |
| 1.4.15 | 118 | 9/21/2026 |
| 1.4.14 | 141 | 8/20/2026 |
| 1.4.13 | 126 | 8/20/2026 |
| 1.4.12 | 135 | 8/20/2026 |
| 1.4.11 | 134 | 8/7/2026 |
| 1.4.10 | 155 | 7/8/2026 |
| 1.4.9 | 147 | 7/8/2026 |
| 1.4.8 | 147 | 7/6/2026 |
| 1.4.7 | 138 | 5/20/2026 |
| 1.4.6 | 135 | 5/20/2026 |
Loading failed