A .NET implementation of Mailgun's Guardpost API
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md

README.md

Guardpost.Net

A .NET implementation of Mailgun's Guardpost API.

Build status

Installation

Just download and add Guardpost.Net.cs to your project.

  • Requires .NET 4.5 or later
  • Requires Json.Net 4.0.1 or later

Usage

//API Key in the My Account tab of your Mailgun account (the one with the “pubkey” prefix).
var mailgunPublicApiKey = "pubkey-1234567890abcdefghijklmnopqrstuvwxyz";

//validate
using (var guardpost = new HttpGuardpostClient(mailgunPublicApiKey))
{
  var validateResponse = await guardpost.ValidateAsync("john.smith@gmail.com").ConfigureAwait(false);
}

//parse (syntax only)
using (var guardpost = new HttpGuardpostClient(mailgunPublicApiKey))
{
  var addresses = new [] { "john.smith@gmail.com", "john@gmail.com", "gmail.com" };
  var parseResponse = await guardpost.ParseAsync(addresses, true).ConfigureAwait(false);
}

//parse (syntax + DNS and ESP specific validation as well)
using (var guardpost = new HttpGuardpostClient(mailgunPublicApiKey))
{
  var addresses = new [] { "john.smith@gmail.com", "john@gmail.com", "gmail.com" };
  var parseResponse = await guardpost.ParseAsync(addresses, false).ConfigureAwait(false);
}

License

The MIT License (MIT)

Copyright (c) 2013 Bates Westmoreland

Full License