CodeLogic.Mail
4.5.2
dotnet add package CodeLogic.Mail --version 4.5.2
NuGet\Install-Package CodeLogic.Mail -Version 4.5.2
<PackageReference Include="CodeLogic.Mail" Version="4.5.2" />
<PackageVersion Include="CodeLogic.Mail" Version="4.5.2" />
<PackageReference Include="CodeLogic.Mail" />
paket add CodeLogic.Mail --version 4.5.2
#r "nuget: CodeLogic.Mail, 4.5.2"
#:package CodeLogic.Mail@4.5.2
#addin nuget:?package=CodeLogic.Mail&version=4.5.2
#tool nuget:?package=CodeLogic.Mail&version=4.5.2
CodeLogic.Mail
SMTP/IMAP email library for CodeLogic with an HTML template engine, attachment support, and mailbox management. Built on MailKit.
Install
dotnet add package CodeLogic.Mail
Quick Start
await Libraries.LoadAsync<MailLibrary>();
var mail = Libraries.Get<MailLibrary>();
// Send a simple email
await mail.Smtp.SendAsync(
from: "noreply@example.com",
to: "user@example.com",
subject: "Welcome!",
htmlBody: "<h1>Hello</h1><p>Welcome aboard.</p>"
);
// Send with the template engine
await mail.Smtp.SendTemplateAsync(
from: "noreply@example.com",
to: "user@example.com",
subject: "Your order is ready",
templatePath: "templates/order-confirmation.html",
model: new { OrderId = "12345", CustomerName = "Alice" }
);
Features
- SMTP — send plain-text and HTML emails, CC/BCC, reply-to, custom headers
- Template Engine — file-based HTML templates with model binding (
{{PropertyName}}) - Attachments — attach files from streams or paths
- IMAP — read mailboxes, fetch messages, move/delete, folder management
- Security — SSL/TLS and STARTTLS support
- Health Checks — verifies SMTP connectivity
Configuration
Auto-generated at data/codelogic/Libraries/CL.Mail/config.mail.json:
{
"enabled": true,
"smtp": {
"host": "smtp.example.com",
"port": 587,
"username": "noreply@example.com",
"password": "your-password",
"securityMode": "StartTls",
"timeoutSeconds": 30
},
"defaultFromEmail": "noreply@example.com",
"defaultFromName": "My App",
"templateDirectory": "templates"
}
Documentation
Requirements
- CodeLogic 3.x or 4.x | .NET 10
License
MIT — see LICENSE
| 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. |
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 |
|---|---|---|
| 4.5.2 | 89 | 5/24/2026 |
| 4.5.1 | 109 | 5/24/2026 |
| 4.5.1-preview.56 | 78 | 5/24/2026 |
| 4.4.2-preview.53 | 45 | 5/24/2026 |
| 4.4.1 | 89 | 5/24/2026 |
| 4.0.5 | 90 | 5/15/2026 |
| 4.0.4 | 98 | 5/9/2026 |
| 4.0.3 | 100 | 5/9/2026 |
| 3.3.1 | 607 | 4/18/2026 |
| 3.3.0 | 103 | 4/18/2026 |
| 3.2.11 | 107 | 4/18/2026 |
| 3.2.10 | 104 | 4/18/2026 |
| 3.2.9 | 96 | 4/18/2026 |
| 3.2.8 | 92 | 4/18/2026 |
| 3.2.7 | 92 | 4/18/2026 |
| 3.2.6 | 97 | 4/18/2026 |
| 3.2.5 | 96 | 4/18/2026 |
| 3.2.4 | 98 | 4/17/2026 |
| 3.2.3 | 92 | 4/17/2026 |
| 3.2.2 | 151 | 4/17/2026 |
# CL.Mail — Changelog
All notable changes to **CodeLogic.Mail** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).
## [4.5.0] — 2026-05-24
### Changed
- **Unified versioning.** All CodeLogic.Libs now share a single version line
controlled by `version.txt` in the repo root. This is a version alignment
release — no functional changes to this library.
## [4.0.4] — 2026-04-16
### Changed
- README + manifest refresh for the v4 baseline. No functional changes vs 4.0.3.
- `LibraryManifest.Version` now reads from assembly metadata.
## [4.0.2] — 2026-04-09
### Changed
- Annotated mail configuration with `[ConfigField]` for the admin UI surface.
- Aligned with the v4 baseline across all libraries.
### Fixed
- Resolved null-reference warnings in `ImapService`.
## [4.0.0] — 2026-04-09
Major rewrite. Republished as v4.0.0 to reset the version line under the
unified v4 baseline. SMTP / IMAP services + a CodeLogic-native template
provider.
### Notes
- Earlier history is retained in the
[git log](https://github.com/Media2A/CodeLogic.Libs/commits/main/CL.Mail).