TailoredApps.Shared.Email.Models 3.0.0-preview.2

This is a prerelease version of TailoredApps.Shared.Email.Models.
dotnet add package TailoredApps.Shared.Email.Models --version 3.0.0-preview.2
                    
NuGet\Install-Package TailoredApps.Shared.Email.Models -Version 3.0.0-preview.2
                    
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.Models" Version="3.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TailoredApps.Shared.Email.Models" Version="3.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="TailoredApps.Shared.Email.Models" />
                    
Project file
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.Models --version 3.0.0-preview.2
                    
#r "nuget: TailoredApps.Shared.Email.Models, 3.0.0-preview.2"
                    
#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.Models@3.0.0-preview.2
                    
#: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.Models&version=3.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TailoredApps.Shared.Email.Models&version=3.0.0-preview.2&prerelease
                    
Install as a Cake Tool

TailoredApps.Shared.Email.Models

The MailMessage model: one e-mail message as returned by IEmailProvider.GetMail in TailoredApps.Shared.Email. It is a separate package so that code which only handles received messages does not have to reference a mail provider.

Installation

dotnet add package TailoredApps.Shared.Email.Models

Registration

Nothing to register: the package contains one model class and no services.

Usage

using TailoredApps.Shared.Email.Models;

public static void Save(MailMessage message, string directory)
{
    Console.WriteLine($"{message.Date:u} {message.Sender}: {message.Topic}");

    if (message.Attachements is not { } attachments)
    {
        return;
    }

    foreach (var (fileName, base64) in attachments)
    {
        // fileName comes from the sender of the message: keep only its last segment
        File.WriteAllBytes(Path.Combine(directory, Path.GetFileName(fileName)), Convert.FromBase64String(base64));
    }
}
Property Type Content
Topic string? Subject
Sender string? Sender
Recipent string? Recipient
Copy string? CC recipient
Body string? Plain-text body
HtmlBody string? HTML body
Attachements Dictionary<string, string>? File name → content encoded as Base64
Date DateTimeOffset When the message was sent

Good to know

  • Recipent and Attachements are spelled this way in the API.
  • Attachment content is a Base64 string, not a byte array: decode it with Convert.FromBase64String.
  • Sender, Recipent and Copy are single strings. The Office 365 provider joins several addresses with commas.
  • Every property except Date can be null.
  • The class has the same name as System.Net.Mail.MailMessage; a file that imports both namespaces has to qualify the type.

Documentation

https://shared.tailoredapps.pl/en/Libraries/Email/Models/

Product 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

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TailoredApps.Shared.Email.Models:

Package Downloads
TailoredApps.Shared.Email

Shared.Email is a simple abstraction for Email for .NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-preview.2 60 11/12/2026
3.0.0-preview.1 67 11/12/2026
2.1.0 123 11/12/2026
2.0.1 115 11/12/2026
2.0.0 133 11/12/2026
1.6.0 146 11/12/2026
1.4.19 525 10/26/2026
1.4.18 622 10/23/2026
1.4.17 815 10/6/2026
1.4.16 166 9/28/2026
1.4.15 168 9/21/2026
1.4.14 191 8/20/2026
1.4.13 196 8/20/2026
1.4.12 195 8/20/2026
1.4.11 186 8/7/2026
1.4.10 296 7/8/2026
1.4.9 204 7/8/2026
1.4.8 205 7/6/2026
1.4.7 203 5/20/2026
1.4.6 211 5/20/2026
Loading failed