Monday
Room 21
09:00 - 17:00
(UTC+02)
2 Days
Sending Millions of Beautiful Emails with .NET
A workshop that covers everything you’ll need to know about working with email in .NET applications
The world runs on email. Book a plane ticket? Get an email. Order a new laptop? Get an email. Forgotten your password? Hey, no problem - we’ll send you an email. The wonderful thing about email is that it’s a free, open standard that isn’t controlled by anybody. The terrible thing about email is that… yep, it’s a free, open standard that isn’t controlled by anybody. To get it right, we need to learn about a dizzying combination of specifications and standards - SMTP, MIME, DNS and MX and DKIM records - and then figure out how to incorporate all that into our own application code.
In this 2-day, hands-on workshop, Dylan Beattie will show you everything you need to know to design, build, test and monitor systems which send email using C# and .NET. Not one or two plain text “hello world” emails: real emails, like the ones you get in your inbox every day. We’ll learn about SMTP, MIME, email authentication and DNS. We’ll explore the .NET packages and libraries we can use to build and send mail messages.
We’ll learn what makes HTML email so complicated - and what we can do about it. We’ll learn how to use modern .NET architectural patterns to scale email delivery, learn how to send thousands of messages as fast as possible without slowing down your application - and how to monitor production systems so that if email stops getting through, you know about it before your customers do.
Day 1: Protocols and Patterns
Email Fundamentals
- Sending our first email: SmtpClient, MailKit and MimeKit
- Understanding SMTP servers
- Creating multipart email messages
- .NET templating engines: RazorLight, Razor Components, Fluid (6m)
HTML Email: What’s the Problem?
- Rendering idiosyncrasies, unsupported HTML, Table-based layouts, dark mode
- Introducing Mailjet Markup Language (MJML)
- Using MJML with .NET
Sending Email from .NET Applications
- Conditional compilation & web previews
- Sending email on demand
- MIME revisited: how attachments actually work
- Working with PDF attachments
Day 2: Bulletproof Email at Scale
Validation and Delivery
- SMTP Servers and Authentication
- Real world address validation
- DNS for email: MX records, SPF, DKIM, DMARC
- Troubleshooting emails with MailTrap
- Tracking and monitoring
High Performance Delivery Patterns
- Guaranteed Single Delivery (and why it’s impossible)
- Retry strategies
- Channels, BackgroundWorkers and feedback loops
- Building a heartbeat monitor with POP3 and IMAP
Monitoring and Visibility
- Configuration and reporting
- Introducing Message Queues
- Using the Outbox pattern
- Building a mail sender microservice with RabbitMQ and EasyNetQ
- Round robin load balancing
- Recording delivery failures
Target Audience and Prerequisites
This workshop is aimed at developers with some experience writing applications using C# and Microsoft .NET.
The workshop can be run in person or online. Attendees will be writing and running .NET code during the workshop, so will need a computer running Windows, macOS or Linux, and the Microsoft .NET 8 or 9 SDK from https://dotnet.microsoft.com/download. An internet connection will be required for most of the exercises.
The sample application and examples used during the workshop all run on .NET 8, and are tested on Linux, macOS and Windows.
The ideal class size for this workshop is between 10–25 people. If you’d like to run it for a smaller or a larger group, please get in touch and let’s chat.