PosInformatique.Foundations.Emailing.Graph
1.7.0
Prefix Reserved
dotnet add package PosInformatique.Foundations.Emailing.Graph --version 1.7.0
NuGet\Install-Package PosInformatique.Foundations.Emailing.Graph -Version 1.7.0
<PackageReference Include="PosInformatique.Foundations.Emailing.Graph" Version="1.7.0" />
<PackageVersion Include="PosInformatique.Foundations.Emailing.Graph" Version="1.7.0" />
<PackageReference Include="PosInformatique.Foundations.Emailing.Graph" />
paket add PosInformatique.Foundations.Emailing.Graph --version 1.7.0
#r "nuget: PosInformatique.Foundations.Emailing.Graph, 1.7.0"
#:package PosInformatique.Foundations.Emailing.Graph@1.7.0
#addin nuget:?package=PosInformatique.Foundations.Emailing.Graph&version=1.7.0
#tool nuget:?package=PosInformatique.Foundations.Emailing.Graph&version=1.7.0
PosInformatique.Foundations.Emailing.Graph
Introduction
PosInformatique.Foundations.Emailing.Graph
provides an IEmailProvider
implementation for PosInformatique.Foundations.Emailing based on the Microsoft Graph API.
It uses Microsoft.Graph.GraphServiceClient
to send templated emails (created via IEmailManager)
through a Microsoft 365 mailbox, using Azure AD authentication.
Authentication is fully driven by an Azure.Core.TokenCredential instance, allowing you to use:
- Managed identity
- Client credentials (client id/secret or certificate)
- Interactive login, device code, etc.
Install
You can install the package from NuGet:
dotnet add package PosInformatique.Foundations.Emailing.Graph
Features
IEmailProviderimplementation usingMicrosoft.Graph.GraphServiceClient.- Simple configuration through
AddEmailing().UseGraph(...). - Authentication configured via
TokenCredential:DefaultAzureCredential(managed identity, VS, CLI, etc.)ClientSecretCredential,ClientCertificateCredential, etc.
- Optional
baseUrlparameter to customize the Graph endpoint (defaults tohttps://graph.microsoft.com/v1.0). - Sends HTML emails using the
EmailMessageproduced by PosInformatique.Foundations.Emailing.
Basic configuration
Using DefaultAzureCredential (managed identity or local dev)
using Azure.Identity;
using Microsoft.Extensions.DependencyInjection;
using PosInformatique.Foundations.EmailAddresses;
using PosInformatique.Foundations.Emailing;
using PosInformatique.Foundations.Emailing.Graph;
var services = new ServiceCollection();
// TokenCredential for Microsoft Graph (for example: managed identity or local dev)
var credential = new DefaultAzureCredential();
services
.AddEmailing(options =>
{
options.SenderEmailAddress = EmailAddress.Parse("sender@yourtenant.onmicrosoft.com");
// Register your templates here...
// options.RegisterTemplate(EmailTemplateIdentifiers.Invitation, invitationTemplate);
})
.UseGraph(credential);
Using client credentials (app registration)
If you want to authenticate with a client id / tenant id / client secret:
using Azure.Identity;
using PosInformatique.Foundations.Emailing.Graph;
var tenantId = configuration["AzureAd:TenantId"];
var clientId = configuration["AzureAd:ClientId"];
var clientSecret = configuration["AzureAd:ClientSecret"];
var credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
services
.AddEmailing(options =>
{
options.SenderEmailAddress = EmailAddress.Parse("sender@yourtenant.onmicrosoft.com");
})
.UseGraph(credential);
The TokenCredential you provide is responsible for acquiring tokens for the Microsoft Graph API. The provider does not manage scopes or credentials itself; this is entirely delegated to the credential implementation.
Custom Graph endpoint
You can optionally customize the Graph base URL (for example, for national clouds):
var baseUrl = "https://graph.microsoft.com/v1.0/beta";
services
.AddEmailing(options =>
{
options.SenderEmailAddress = EmailAddress.Parse("sender@yourtenant.onmicrosoft.com");
})
.UseGraph(credential, baseUrl);
If baseUrl is null, https://graph.microsoft.com/v1.0 is used by default.
Typical end-to-end usage
- Configure emailing (sender address, templates) with
AddEmailing(...). - Configure the Graph provider with
UseGraph(TokenCredential, baseUrl?). - Inject
IEmailManagerand create emails from template identifiers. - Add recipients and models.
- Call
SendAsync(...)to send emails via Microsoft Graph.
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Graph (>= 6.0.3)
- PosInformatique.Foundations.Emailing (>= 1.7.0)
-
net11.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Graph (>= 6.0.3)
- PosInformatique.Foundations.Emailing (>= 1.7.0)
-
net8.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Graph (>= 6.0.3)
- PosInformatique.Foundations.Emailing (>= 1.7.0)
-
net9.0
- Azure.Identity (>= 1.17.1)
- Microsoft.Graph (>= 6.0.3)
- PosInformatique.Foundations.Emailing (>= 1.7.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 |
|---|---|---|
| 1.7.0 | 52 | 11/23/2026 |
| 1.7.0-rc.1 | 50 | 11/23/2026 |
| 1.6.0 | 53 | 11/21/2026 |
| 1.6.0-rc.2 | 48 | 11/18/2026 |
| 1.6.0-rc.1 | 61 | 11/17/2026 |
| 1.5.0 | 104 | 11/10/2026 |
| 1.5.0-rc.1 | 63 | 11/10/2026 |
| 1.4.0 | 94 | 11/9/2026 |
| 1.4.0-rc.5 | 59 | 11/7/2026 |
| 1.4.0-rc.4 | 74 | 10/24/2026 |
| 1.4.0-rc.3 | 72 | 10/14/2026 |
| 1.4.0-rc.2 | 66 | 10/6/2026 |
| 1.4.0-rc.1 | 71 | 10/5/2026 |
| 1.3.0 | 148 | 10/2/2026 |
| 1.2.0 | 144 | 8/18/2026 |
1.4.0
- Upgrade the [Microsoft.Graph](Microsoft.Graph) dependency to version 6.0.3 at minimum to fix security vulnerabilities.
1.3.0
- Added the support to raise a `EmailProviderException` when the email provider fails to send an email.
1.1.0
- Add the support to send emails with attachments using Microsoft Graph Emailing provider.
1.0.0
- Initial release with Microsoft Graph Emailing provider.