Serilog.Sinks.Email
3.0.0-dev-00171
Prefix Reserved
See the version list below for details.
dotnet add package Serilog.Sinks.Email --version 3.0.0-dev-00171
NuGet\Install-Package Serilog.Sinks.Email -Version 3.0.0-dev-00171
<PackageReference Include="Serilog.Sinks.Email" Version="3.0.0-dev-00171" />
<PackageVersion Include="Serilog.Sinks.Email" Version="3.0.0-dev-00171" />
<PackageReference Include="Serilog.Sinks.Email" />
paket add Serilog.Sinks.Email --version 3.0.0-dev-00171
#r "nuget: Serilog.Sinks.Email, 3.0.0-dev-00171"
#:package Serilog.Sinks.Email@3.0.0-dev-00171
#addin nuget:?package=Serilog.Sinks.Email&version=3.0.0-dev-00171&prerelease
#tool nuget:?package=Serilog.Sinks.Email&version=3.0.0-dev-00171&prerelease
Serilog.Sinks.Email 
Sends log events by SMTP email.
ℹ️ Version 3.x of this package changes the name and structure of many configuration parameters from their 2.x names; see below for detailed information.
Package - Serilog.Sinks.Email
await using var log = new LoggerConfiguration()
.WriteTo.Email(
from: "app@example.com",
to: "support@example.com",
host: "smtp.example.com")
.CreateLogger();
Supported options are:
| Parameter | Description |
|---|---|
from |
The email address emails will be sent from. |
to |
The email address emails will be sent to. Multiple addresses can be separated with commas or semicolons. |
host |
The SMTP server to use. |
port |
The port used for the SMTP connection. The default is 25. |
connectionSecurity |
Choose the security applied to the SMTP connection. This enumeration type is supplied by MailKit. The default is Auto. |
credentials |
The network credentials to use to authenticate with the mail server. |
subject |
A message template describing the email subject. The default is "Log Messages". |
body |
A message template describing the format of the email body. The default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". |
formatProvider |
Supplies culture-specific formatting information. The default is to use the current culture. |
An overload accepting EmailSinkOptions can be used to specify advanced options such as batched and/or HTML body templates.
Sending batch email
To send batch email, supply WriteTo.Email with a batch size:
await using var log = new LoggerConfiguration()
.WriteTo.Email(
options: new()
{
From = "app@example.com",
To = "support@example.com",
Host = "smtp.example.com",
},
batchingOptions: new()
{
BatchSizeLimit = 10,
Period = TimeSpan.FromSeconds(30),
})
.CreateLogger();
Batch formatting can be customized using options.Body.
Sending HTML email
To send HTML email, specify a custom IBatchTextFormatter in options.Body and set options.IsBodyHtml to true:
await using var log = new LoggerConfiguration()
.WriteTo.Email(
options: new()
{
From = "app@example.com",
To = "support@example.com",
Host = "smtp.example.com",
Body = new MyHtmlBodyFormatter(),
IsBodyHtml = true,
},
batchingOptions: new()
{
BatchSizeLimit = 10,
Period = TimeSpan.FromSeconds(30),
})
.CreateLogger();
A simplistic HTML formatter is shown below:
class MyHtmlBodyFormatter : IBatchTextFormatter
{
public void FormatBatch(IEnumerable<LogEvent> logEvents, TextWriter output)
{
output.Write("<table>");
foreach (var logEvent in logEvents)
{
output.Write("<tr>");
Format(logEvent, output);
output.Write("</tr>");
}
output.Write("</table>");
}
public void Format(LogEvent logEvent, TextWriter output)
{
using var buffer = new StringWriter();
logEvent.RenderMessage(buffer);
output.Write(WebUtility.HtmlEncode(buffer.ToString()));
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
NuGet packages (32)
Showing the top 5 NuGet packages that depend on Serilog.Sinks.Email:
| Package | Downloads |
|---|---|
|
Azasp.Core
Package Description |
|
|
TianCheng.Model
实体对象基类,及其常用操作。 常用操作包括:对象转换、序列化、日志、常用异常处理、依赖注入。 |
|
|
Zavi.Extensions.Logging
Package Description |
|
|
Netsun.Forms
MVC forms and resources management - internal company package |
|
|
CodeZero
CodeZero is a set of common implementations to help you implementing Clean Architecture, DDD, CQRS, Specification Patterns and another facilities for new modern web applications is an open-source project written in .NET Core. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Serilog.Sinks.Email:
| Repository | Stars |
|---|---|
|
OmniGUI/OmniGUI
A cross-platform GUI framework from scratch just to learn
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.0 | 379,299 | 4/19/2025 |
| 4.1.0-dev-02303 | 244 | 4/19/2025 |
| 4.1.0-dev-02301 | 439 | 4/8/2025 |
| 4.0.1-dev-00185 | 245 | 4/8/2025 |
| 4.0.0 | 829,393 | 6/9/2024 |
| 4.0.0-dev-00177 | 195 | 6/9/2024 |
| 3.0.0 | 236,117 | 2/29/2024 |
| 3.0.0-dev-00174 | 216 | 6/9/2024 |
| 3.0.0-dev-00171 | 185 | 6/9/2024 |
| 3.0.0-dev-00166 | 1,154 | 1/4/2024 |
| 3.0.0-dev-00161 | 588 | 12/23/2023 |
| 2.4.1-dev-00147 | 17,598 | 2/8/2022 |
| 2.4.1-dev-00135 | 9,301 | 8/9/2021 |
| 2.4.1-dev-00128 | 48,435 | 6/4/2021 |
| 2.4.0 | 3,311,408 | 9/21/2020 |
| 2.4.0-dev-00116 | 4,495 | 5/18/2020 |
| 2.3.1-dev-00101 | 6,096 | 5/2/2019 |
| 2.3.1-dev-00100 | 1,117 | 4/16/2019 |
| 2.3.1-dev-00092 | 2,517 | 10/30/2018 |
| 2.3.0 | 2,403,046 | 7/28/2017 |
| 2.2.2-dev-00070 | 2,695 | 3/11/2017 |
| 2.2.1-dev-00067 | 1,257 | 3/4/2017 |
| 2.2.0 | 65,598 | 1/22/2017 |
| 2.2.0-dev-00057 | 1,280 | 1/17/2017 |
| 2.1.1-dev-00056 | 1,213 | 1/17/2017 |
| 2.1.0 | 63,869 | 11/22/2016 |
| 2.1.0-dev-00048 | 1,254 | 11/22/2016 |
| 2.1.0-dev-00046 | 1,360 | 10/14/2016 |
| 2.0.0 | 84,393 | 7/3/2016 |
| 1.5.37 | 39,050 | 11/13/2015 |
| 1.5.34 | 2,421 | 10/13/2015 |
| 1.5.25 | 4,521 | 9/21/2015 |
| 1.5.23 | 2,079 | 9/15/2015 |
| 1.5.20 | 1,872 | 9/14/2015 |
| 1.5.15 | 3,938 | 7/30/2015 |
| 1.5.13 | 11,984 | 4/3/2015 |
| 1.5.11 | 1,961 | 4/2/2015 |
| 1.5.10 | 1,952 | 4/1/2015 |
| 1.5.9 | 1,984 | 3/26/2015 |
| 1.5.8 | 1,904 | 3/26/2015 |
| 1.5.5 | 2,104 | 3/19/2015 |
| 1.5.3 | 1,973 | 3/13/2015 |
| 1.4.196 | 2,682 | 2/22/2015 |
| 1.4.182 | 2,312 | 2/15/2015 |
| 1.4.168 | 2,153 | 2/8/2015 |
| 1.4.155 | 1,974 | 2/1/2015 |
| 1.4.139 | 1,958 | 1/23/2015 |
| 1.4.118 | 2,179 | 1/13/2015 |
| 1.4.113 | 2,233 | 1/6/2015 |
| 1.4.102 | 4,245 | 12/21/2014 |
| 1.4.99 | 2,295 | 12/18/2014 |
| 1.4.97 | 2,112 | 12/18/2014 |
| 1.4.76 | 2,275 | 12/8/2014 |
| 1.4.39 | 2,191 | 11/26/2014 |
| 1.4.34 | 2,048 | 11/24/2014 |
| 1.4.28 | 2,017 | 11/24/2014 |
| 1.4.27 | 2,040 | 11/23/2014 |
| 1.4.23 | 2,120 | 11/21/2014 |
| 1.4.22 | 2,023 | 11/21/2014 |
| 1.4.21 | 2,082 | 11/21/2014 |
| 1.4.18 | 3,007 | 11/18/2014 |
| 1.4.15 | 3,515 | 11/4/2014 |
| 1.4.14 | 1,983 | 10/23/2014 |
| 1.4.13 | 1,891 | 10/23/2014 |
| 1.4.12 | 1,992 | 10/12/2014 |
| 1.4.11 | 1,944 | 10/8/2014 |
| 1.4.10 | 2,051 | 9/26/2014 |
| 1.4.9 | 1,977 | 9/17/2014 |
| 1.4.8 | 2,040 | 9/11/2014 |
| 1.4.7 | 1,962 | 9/1/2014 |
| 1.4.6 | 1,915 | 8/31/2014 |
| 1.4.5 | 2,002 | 8/27/2014 |
| 1.4.4 | 1,963 | 8/27/2014 |
| 1.4.3 | 2,026 | 8/25/2014 |
| 1.4.2 | 1,974 | 8/23/2014 |
| 1.4.1 | 1,930 | 8/23/2014 |
| 1.3.43 | 1,953 | 8/4/2014 |
| 1.3.42 | 1,907 | 7/30/2014 |
| 1.3.41 | 1,911 | 7/28/2014 |
| 1.3.40 | 1,879 | 7/26/2014 |
| 1.3.39 | 1,974 | 7/25/2014 |
| 1.3.37 | 1,924 | 7/25/2014 |
| 1.3.36 | 1,904 | 7/20/2014 |
| 1.3.35 | 1,874 | 7/17/2014 |
| 1.3.34 | 2,033 | 7/6/2014 |
| 1.3.33 | 1,911 | 6/30/2014 |
| 1.3.30 | 1,966 | 6/19/2014 |
| 1.3.29 | 1,944 | 6/19/2014 |
| 1.3.28 | 2,003 | 6/19/2014 |
| 1.3.27 | 1,955 | 6/18/2014 |
| 1.3.26 | 1,909 | 6/18/2014 |
| 1.3.25 | 1,937 | 6/9/2014 |
| 1.3.24 | 1,946 | 5/21/2014 |
| 1.3.23 | 1,947 | 5/20/2014 |
| 1.3.20 | 1,947 | 5/18/2014 |
| 1.3.19 | 1,903 | 5/17/2014 |
| 1.3.18 | 1,904 | 5/17/2014 |
| 1.3.17 | 1,954 | 5/17/2014 |
| 1.3.16 | 1,990 | 5/17/2014 |
| 1.3.15 | 1,961 | 5/16/2014 |
| 1.3.14 | 1,974 | 5/16/2014 |
| 1.3.13 | 1,947 | 5/16/2014 |
| 1.3.12 | 1,972 | 5/14/2014 |
| 1.3.7 | 1,978 | 5/11/2014 |
| 1.3.6 | 1,916 | 5/9/2014 |
| 1.3.5 | 1,896 | 5/6/2014 |
| 1.3.4 | 1,903 | 5/4/2014 |
| 1.3.3 | 2,127 | 4/28/2014 |
| 1.3.1 | 2,183 | 4/26/2014 |
| 1.2.53 | 1,937 | 4/26/2014 |
| 1.2.52 | 1,951 | 4/24/2014 |
| 1.2.51 | 2,162 | 4/18/2014 |
| 1.2.50 | 2,045 | 4/18/2014 |
| 1.2.49 | 2,152 | 4/17/2014 |
| 1.2.48 | 2,135 | 4/14/2014 |
| 1.2.47 | 2,095 | 4/14/2014 |
| 1.2.45 | 2,123 | 4/13/2014 |
| 1.2.44 | 2,161 | 4/9/2014 |
| 1.2.41 | 2,073 | 4/7/2014 |
| 1.2.40 | 2,038 | 4/7/2014 |
| 1.2.39 | 2,041 | 3/29/2014 |
| 1.2.37 | 2,058 | 3/29/2014 |
| 1.2.29 | 1,999 | 3/16/2014 |
| 1.2.27 | 1,969 | 3/14/2014 |
| 1.2.26 | 1,975 | 3/12/2014 |
| 1.2.25 | 2,288 | 2/20/2014 |
| 0.9.9 | 2,076 | 11/23/2013 |
| 0.9.8 | 5,902 | 11/1/2013 |