Skip to content

Instantly share code, notes, and snippets.

@RichardD2
RichardD2 / SmtpClientExtensions.cs
Last active January 28, 2019 10:35 — forked from mattbenic/SmtpClientExtensions.cs
Extension method to have SmtpClient's SendMailAsync respond to a CancellationToken
using System;
using System.ComponentModel;
using System.Net.Mail;
using System.Threading;
using System.Threading.Tasks;
public static class SmtpClientExtensions
{
/// <summary>
/// Sends the specified message to an SMTP server for delivery as an asynchronous operation.