danielsen / NetSPF

.NET SPF tools
MIT License
2 stars 3 forks source link
email smtp spf

NetSPF

NetSPF is a SPF verification utility for .NET.

Packages

Dependencies

Usage

In keeping with convention the SpfResolver class provides a function called CheckHost as an entry point to verification. CheckHost takes the following parameters:

For example:

var ipAddress = IPAddress.Parse("11.22.33.44");
var result = SpfResolver.CheckHost(ipAddress, "zz.com", "noreply@zz.com", "zz.com", "aa.com");

// Using a specific DNS host.
var dnsHost = IPAddress.Parse("1.1.1."); // Clodflare DNS
var ipAddress = IPAddress.Parse("11.22.33.44");
var result = SpfResolver.CheckHost(ipAddress, "zz.com", "noreply@zz.com", "zz.com", "aa.com", dnsHost);

CheckHost returns a KeyValuePair<SpfResult, string> where string is an explanation if any or simply the string representation of the SpfResult