EnvelopeFlow.Providers.Email.Smtp 0.1.0-alpha.3.1

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

EnvelopeFlow.Providers.Email.Smtp

First-class SMTP delivery through MailKit, usable with Mailgun SMTP, SES SMTP, and other SMTP servers. There is no endpoint, user schema, or conversation-store requirement.

Register with services.AddEnvelopeFlowSmtpEmail(options => { ... }), then inject IEmailTransport. Registration preserves existing application transport and client-factory implementations. Core registration does not require this provider package.

IEmailTransport transport = new SmtpEmailTransport(new SmtpEmailOptions
{
    Host = "smtp.example.com",
    Username = configuration["Smtp:Username"],
    Password = configuration["Smtp:Password"],
});

EmailSubmissionResult result = await transport.SendAsync(new EmailMessage
{
    From = new EmailAddress("notifications@example.com", "Example"),
    To = [new EmailAddress("recipient@example.com")],
    Subject = "Your update",
    TextBody = "Your update is ready.",
    HtmlBody = "<p>Your update is ready.</p>",
}, cancellationToken);

StartTls is required by default, with platform certificate validation. SslOnConnect supports implicit TLS. Explicit None supports unauthenticated local test servers; credentials are refused without TLS. The transport snapshots and validates options at construction.

Each call opens one connection and makes one submission attempt. Acknowledged SMTP acceptance remains accepted if disconnect/disposal fails. Network interruption or cancellation during submission returns Unknown with ReviewBeforeRetry; earlier caller cancellation throws. The result never exposes exception text, SMTP reply text, credentials, or message contents. Explicit SMTP rejections distinguish 4xx retry advice from 5xx permanent refusal. Connection establishment failures can be retried; authentication and TLS configuration failures require correction.

The supplied MailKit adapter preserves explicit SMTP 530 authentication-required replies as definite rejection, including replies at MAIL, RCPT or the final DATA response. A missing final response remains uncertain. Ordinary exceptions from replaceable clients retain conservative submission semantics; only the real adapter marks this known negative reply. See MailKit's tagged reply handling and RFC 4954 status codes.

Accepted and Unknown results carry the generated Message-Id (no angle brackets) as ProviderMessageId; record it to thread later replies. Reply threading uses ordinary In-Reply-To and References extension headers. Messages support multipart alternatives, Cc/Bcc, reply-to, repeated extension headers, and in-memory attachments. Structured MIME headers must use their typed fields; raw routing/content headers are refused. Applications own attachment size limits, consent, scheduling, recipient fan-out, and durable state. Sending a multi-recipient message is one submission, with no per-recipient receipt claims.

ISmtpEmailClientFactory allows fake connections or a custom MailKit wrapper for testing. Optional PooledSmtpEmailTransport and services.AddEnvelopeFlowPooledSmtpEmail(...) reuse a bounded number of exclusively owned connections, limit messages/idle time, and discard failed or uncertain sessions without resending. Dispose the pool at host shutdown; the DI singleton is disposed with the container. Tests include a real MailKit pooled connection sending three messages through one handshake against an unauthenticated loopback SMTP fixture.

The supplied MailKit adapter requires negotiated SMTPUTF8 and 8BITMIME when an address local-part needs UTF-8, including header-only addresses such as Reply-To. Unsupported sessions reject with Configuration before issuing MAIL FROM; supported sessions declare SMTPUTF8 for both international envelopes and headers. Unicode display names and IDN domains remain usable on legacy servers through MIME encoding and Punycode. Loopback tests exercise these negotiated behaviors for standalone and pooled clients. Real-provider compatibility certification remains a deployment check; no external credentials are used in automated tests.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
0.1.0-alpha.3.1 45 11/22/2026
0.1.0-alpha.2.1 58 11/9/2026