Naravel.Mail.Smtp
0.2.0
dotnet add package Naravel.Mail.Smtp --version 0.2.0
NuGet\Install-Package Naravel.Mail.Smtp -Version 0.2.0
<PackageReference Include="Naravel.Mail.Smtp" Version="0.2.0" />
<PackageVersion Include="Naravel.Mail.Smtp" Version="0.2.0" />
<PackageReference Include="Naravel.Mail.Smtp" />
paket add Naravel.Mail.Smtp --version 0.2.0
#r "nuget: Naravel.Mail.Smtp, 0.2.0"
#:package Naravel.Mail.Smtp@0.2.0
#addin nuget:?package=Naravel.Mail.Smtp&version=0.2.0
#tool nuget:?package=Naravel.Mail.Smtp&version=0.2.0
Naravel.Mail.Smtp
Optional SMTP transport for Naravel.Mail, built on MailKit.
| Fact | Detail |
|---|---|
| Install | dotnet add package Naravel.Mail.Smtp |
| Targets | .NET 10 |
| Needs | Naravel.Mail, which NuGet installs with it |
| Driver | smtp, added with AddNaravelMailSmtp |
| Security | StartTls (the default, port 587), SslOnConnect (port 465) or None (clear text, for local test servers only) |
What you get
- TLS unless you say otherwise.
Securitydefaults toStartTls, and clear text needs an explicit"Security": "None". - Authentication only when asked. Without a
Usernameno authentication is attempted. - A connection per send. Each send connects, authenticates, sends and disconnects, so concurrent sends are safe.
- Safe headers.
Bccrecipients are used for delivery only and never appear in headers, and a subject with line breaks cannot inject a header. - A bad setting fails with its name. The first send reports which key is wrong, and the application still starts.
Quick start
builder.Services.AddNaravelMail(builder.Configuration);
builder.Services.AddNaravelMailSmtp(builder.Configuration); // after AddNaravelMail
{
"Mail": {
"Default": "relay",
"From": "app@example.com",
"Mailers": {
"relay": { "Driver": "smtp", "Host": "smtp.example.com", "Port": 587, "Security": "StartTls", "Username": "app", "Timeout": 30 }
}
}
}
Timeout is in seconds. Keep the password out of the file: set it in user secrets or as Mail__Mailers__relay__Password. A server rejection or a network failure reaches the caller as the MailKit exception, and nothing is retried inside the transport.
Related packages
| Package | Adds |
|---|---|
Naravel.Mail |
Mailables, named transports and the fake that this transport delivers for |
Naravel.Mail.Queue |
Queues the message, and a worker sends it through the transport you named |
Learn more
- Mail: English guide
- Changelog · Source and issues · MIT license
Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.
| 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. |
-
net10.0
- MailKit (>= 4.18.2)
- Naravel.Mail (>= 0.2.0)
- System.Security.Cryptography.Pkcs (>= 10.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release notes: https://github.com/km-arc/Naravel/releases/tag/v0.2.0 - full history: https://github.com/km-arc/Naravel/blob/main/CHANGELOG.md