FluentEmail.Graph 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluentEmail.Graph --version 2.0.0
NuGet\Install-Package FluentEmail.Graph -Version 2.0.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="FluentEmail.Graph" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentEmail.Graph --version 2.0.0
#r "nuget: FluentEmail.Graph, 2.0.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.
// Install FluentEmail.Graph as a Cake Addin
#addin nuget:?package=FluentEmail.Graph&version=2.0.0

// Install FluentEmail.Graph as a Cake Tool
#tool nuget:?package=FluentEmail.Graph&version=2.0.0

FluentEmail.Graph

Sender for FluentEmail that uses Microsoft Graph API.

Nuget

CI CodeQL Publish

Usage

Call one of the AddGraphSender extension methods.

var graphSenderOptions = this.Configuration
    .GetSection("GraphSenderOptions")
    .Get<GraphSenderOptions>();
services.AddFluentEmail("alias@test.com")
    .AddRazorRenderer()
    .AddGraphSender(graphSenderOptions);

Example config in appsettings.json

{
  "GraphSenderOptions": {
    "TenantId": "your tenant id",
    "ClientId": "your app id",
    "Secret": "your secret here"
  }
}

v2

The original version only used the user: sendMail Graph API endpoint. This could not handle attachments over 3MB.

Starting with v2, if you have included any attachments, the implementation will switch to the following:

⚠️BREAKING: The Mail.ReadWrite permission is required when adding attachments.

Microsoft Docs on using the Graph API to send large attachments

⚠️REMOVED: Unfortunately, the Microsoft Graph API Send method does not have a SaveSentItems argument like the SendMail method that was previously used. The SaveSentItems option has been removed and there is no way to disable this anymore. ( See Link 1 , Link 2, and Link 3).

Uploading attachments to a draft message was contributed by @huntmj01.

Graph API Permissions

The Mail.Send permission must be granted.

Adding attachments? Then the Mail.ReadWrite permissions is also required.

Release

Create new release with creation of new tag on main branch.

Start publish manually, for the new tag. This will push the package to github and nuget.org

Origin

Code originally written by Matt Goldman and merged into FluentEmail repo. But it was not published to NuGet until January 2021. Because we needed this implementation we created a separate repo, modified the code a bit and published it to NuGet.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.5.0 6,838 12/28/2023
2.4.0 19,794 4/7/2023
2.3.0 3,459 3/9/2023
2.2.0 1,428 3/6/2023
2.1.0 13,207 10/10/2022
2.0.0 1,570 9/14/2022
1.5.1 6,216 6/8/2022
1.4.0 1,929 4/8/2022
1.2.0 14,928 10/19/2021
1.1.0 1,968 2/22/2021
1.0.0 224 1/4/2021