OutWit.Shared.Email.Provider.Smtp
1.0.1
dotnet add package OutWit.Shared.Email.Provider.Smtp --version 1.0.1
NuGet\Install-Package OutWit.Shared.Email.Provider.Smtp -Version 1.0.1
<PackageReference Include="OutWit.Shared.Email.Provider.Smtp" Version="1.0.1" />
<PackageVersion Include="OutWit.Shared.Email.Provider.Smtp" Version="1.0.1" />
<PackageReference Include="OutWit.Shared.Email.Provider.Smtp" />
paket add OutWit.Shared.Email.Provider.Smtp --version 1.0.1
#r "nuget: OutWit.Shared.Email.Provider.Smtp, 1.0.1"
#:package OutWit.Shared.Email.Provider.Smtp@1.0.1
#addin nuget:?package=OutWit.Shared.Email.Provider.Smtp&version=1.0.1
#tool nuget:?package=OutWit.Shared.Email.Provider.Smtp&version=1.0.1
OutWit.Shared.Email.Provider.Smtp
SMTP email transport plugin for OutWit hosts. Implements IEmailTransport over MailKit — covers on-prem relays, corporate Exchange, hosted SMTP services (SendGrid SMTP, Amazon SES SMTP, Mailgun SMTP), and local dev catchers like MailHog and Papercut-SMTP.
Configuration
Plugin reads its own appsettings.json from inside the deployed module folder:
{
"Smtp": {
"Host": "",
"Port": 587,
"Username": "",
"Password": "",
"Security": "StartTls",
"Timeout": "00:00:30",
"AllowSelfSignedCertificates": false
}
}
| Setting | Default | Description |
|---|---|---|
Host |
(required) | SMTP server host name. |
Port |
587 |
TCP port. Typical values: 25 (relay/no-TLS), 465 (SslOnConnect), 587 (StartTls). |
Username |
(empty) | Auth username. Leave blank for unauthenticated relays (LAN, dev SMTP catchers). |
Password |
(empty) | Auth password. Should be supplied via env var Smtp__Password — keep the JSON value blank. |
Security |
StartTls |
TLS mode: None, StartTls, SslOnConnect, Auto. |
Timeout |
00:00:30 |
Connection / send timeout (hh:mm:ss). |
AllowSelfSignedCertificates |
false |
Accept untrusted server certs. Dev only — MailHog/Papercut use self-signed certs. Never in production. |
Env-var override convention
Standard .NET configuration binding maps double-underscore env vars to JSON keys:
Smtp__Host=smtp.example.com
Smtp__Port=587
Smtp__Username=postmaster@example.com
Smtp__Password=******** # never put this in JSON
Smtp__Security=StartTls
Installation
dotnet add package OutWit.Shared.Email.Provider.Smtp
The plugin's build/.targets auto-copies the module to your output @Email/smtp.module/ at build time. The host's WitPluginLoader<IEmailProviderPlugin>(Path.Combine(AppContext.BaseDirectory, "@Email")) discovers it.
Failure classification
MailKit exceptions are mapped to neutral EmailFailureKind values so the host's failure tracker / retry policy works the same regardless of provider:
| Exception / SMTP code | Kind |
|---|---|
AuthenticationException, SMTP 535 |
AuthFailure |
| SMTP 421, 450, 451, 452 | Transient (caller may retry) |
| SMTP 550, 551, 553 | InvalidRecipient (don't retry, mark recipient bad) |
| SMTP 552 (message too large) | Permanent |
IOException / SocketException / TimeoutException |
Transient |
| Any other 5xx, generic exceptions | Permanent |
Testing locally with MailHog
docker run -d -p 1025:1025 -p 8025:8025 --name mailhog mailhog/mailhog
Plugin config (or env):
Smtp__Host=localhost
Smtp__Port=1025
Smtp__Security=None
UI at http://localhost:8025 shows captured messages.
License
Apache 2.0 — see LICENSE.txt.
| Product | Versions 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. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.