SendWithMailgun 1.1.8
See the version list below for details.
dotnet add package SendWithMailgun --version 1.1.8
NuGet\Install-Package SendWithMailgun -Version 1.1.8
<PackageReference Include="SendWithMailgun" Version="1.1.8" />
<PackageVersion Include="SendWithMailgun" Version="1.1.8" />
<PackageReference Include="SendWithMailgun" />
paket add SendWithMailgun --version 1.1.8
#r "nuget: SendWithMailgun, 1.1.8"
#:package SendWithMailgun@1.1.8
#addin nuget:?package=SendWithMailgun&version=1.1.8
#tool nuget:?package=SendWithMailgun&version=1.1.8
SendWithMailgun
SendWithMailgun is a really small class library with only one goal in mind: sending an email with Mailgun. That's it. Need other features? Not here, sorry 😦
New in v1.1.x
- Dependency updates
- Remove Newtonsoft.Json
- Add support for email validation
- v1.1.8: validation results of
do_not_sendandcatch_allnow deserialize correctly; unrecognizedresultorriskvalues map toUnknowninstead of throwing
Help or feedback
First things first - do you need help or have feedback? File an issue! Happy to help.
Simple Email Example
using SendWithMailgun;
MailgunSender sender = new MailgunSender("[mydomain.com]", "[apikey]");
sender.Logger = Console.WriteLine; // if you want log messages
string id = null;
id = sender.Send("to", "from", "subject", "body"); // text
id = sender.Send("to", "from", "subject", "html", true); // html
Console.WriteLine("Message ID: " + id);
Simple Validation Example
using SendWithMailgun;
MailgunValidator validator = new MailgunValidator("[apikey]");
MailgunValidationResult result = validator.Validate("[emailaddress]");
Console.WriteLine("Result: " + result.Result.ToString() + " risk level: " + result.Risk.ToString());
Validate and ValidateAsync return null when Mailgun responds with a non-200 status code or an empty body. Result and Risk map Mailgun's wire values (deliverable, undeliverable, do_not_send, catch_all, unknown and high, medium, low, unknown) to ResultEnum and RiskEnum. Any value not recognized by this version of the library is mapped to Unknown.
Regional Endpoints
Both classes accept a base URL, for example to use Mailgun's EU region:
MailgunSender sender = new MailgunSender("[mydomain.com]", "[apikey]", "https://api.eu.mailgun.net/v3/");
MailgunValidator validator = new MailgunValidator("[apikey]", "https://api.eu.mailgun.net/v4/");
Running the Tests
Tests are written once in src/Test.Shared using Touchstone and run through three runners. They use an in-process mock Mailgun server bound to 127.0.0.1, so no Mailgun account or API key is required.
dotnet run --project src/Test.Automated -f net10.0 # console runner
dotnet run --project src/Test.Automated -f net10.0 -- --results out.json # console runner with JSON results
dotnet test src/Test.Xunit # xUnit
dotnet test src/Test.Nunit # NUnit
src/Test is an interactive console application for sending and validating against the real Mailgun API with your own domain and keys.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- RestWrapper (>= 3.2.0)
-
.NETFramework 4.8
- RestWrapper (>= 3.2.0)
-
.NETStandard 2.1
- RestWrapper (>= 3.2.0)
-
net10.0
- RestWrapper (>= 3.2.0)
-
net8.0
- RestWrapper (>= 3.2.0)
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 |
|---|---|---|
| 1.2.2 | 373 | 11/18/2026 |
| 1.2.1 | 593 | 10/3/2026 |
| 1.2.0 | 183 | 10/3/2026 |
| 1.1.8 | 128 | 10/3/2026 |
| 1.1.7 | 625 | 7/9/2026 |
| 1.1.6 | 1,370 | 10/30/2024 |
| 1.1.5 | 816 | 10/3/2023 |
| 1.1.2 | 519 | 9/10/2023 |
| 1.1.1 | 2,229 | 7/23/2023 |
| 1.1.0 | 419 | 7/22/2023 |
| 1.0.0.5 | 6,974 | 11/12/2021 |
| 1.0.0.4 | 3,002 | 9/16/2021 |
| 1.0.0.3 | 1,474 | 8/14/2021 |
| 1.0.0.2 | 822 | 7/28/2021 |
| 1.0.0.1 | 1,632 | 5/23/2021 |
| 1.0.0 | 648 | 5/23/2021 |
Fix validation result deserialization for do_not_send and catch_all; unrecognized result/risk values map to Unknown.