dotnet

email

SMTP Emails in .NET: 1 Powerful library to Improve Email Delivery

Are you building a .NET library that needs to send SMTP emails? One of the key considerations in such a library is to provide fault tolerance when sending emails. After all, there could be a number of reasons why the email may not be delivered – the SMTP server could be down, the credentials could be incorrect, or the message could be invalid. To ensure that your library handles these scenarios gracefully, you can use Polly for .NET. In this tutorial, we’ll show you how to use Polly to provide fault tolerance in your .NET library for sending SMTP emails. We’ll start by creating a new .NET library project, then show you how to add the required packages and set up the project. We’ll also walk you through how to implement the SmtpEmailService class, which sends the actual email, and how to register it with Polly in the ServiceRegistration class. By the end of this tutorial, you’ll have a .NET library that is fault-tolerant when sending SMTP emails, thanks to the power of Polly.

Enriching Serilog log entries

Serilog is a powerful and flexible logging library for .NET applications. It allows developers to easily capture log data and send it to various destinations, such as files, databases, and cloud services. One of the key features of Serilog is its ability to enrich log data with contextual information, such as properties and structured data. In this blog we focus on a Serilog library that I recently published and what features it could add to your logs.