NetSPF
is a SPF verification utility for .NET.
1.2.0
.NET Standard 2.0
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