PosInformatique.Foundations.Emailing.Graph
1.0.0
Prefix Reserved
See the version list below for details.
dotnet add package PosInformatique.Foundations.Emailing.Graph --version 1.0.0
NuGet\Install-Package PosInformatique.Foundations.Emailing.Graph -Version 1.0.0
<PackageReference Include="PosInformatique.Foundations.Emailing.Graph" Version="1.0.0" />
<PackageVersion Include="PosInformatique.Foundations.Emailing.Graph" Version="1.0.0" />
<PackageReference Include="PosInformatique.Foundations.Emailing.Graph" />
paket add PosInformatique.Foundations.Emailing.Graph --version 1.0.0
#r "nuget: PosInformatique.Foundations.Emailing.Graph, 1.0.0"
#:package PosInformatique.Foundations.Emailing.Graph@1.0.0
#addin nuget:?package=PosInformatique.Foundations.Emailing.Graph&version=1.0.0
#tool nuget:?package=PosInformatique.Foundations.Emailing.Graph&version=1.0.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 was computed. 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. |
-
net8.0
- Microsoft.Graph (>= 5.89.0)
- PosInformatique.Foundations.Emailing (>= 1.0.0)
-
net9.0
- Microsoft.Graph (>= 5.89.0)
- PosInformatique.Foundations.Emailing (>= 1.0.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.1.0-rc.2 | 60 | 1/26/2026 |
| 1.1.0-rc.1 | 60 | 1/23/2026 |
| 1.0.0 | 431 | 11/19/2025 |
| 1.0.0-rc.4 | 385 | 11/19/2025 |
| 1.0.0-rc.3 | 377 | 11/18/2025 |
| 1.0.0-rc.2 | 374 | 11/18/2025 |
| 1.0.0-rc.1 | 375 | 11/18/2025 |
1.0.0
- Initial release with Microsoft Graph Emailing provider.