Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

Postmark Spamcheck

Version

A c# library to help you query Postmark's spamcheck api

Usage

Add as a dependency

dotnet add package PostmarkSpamcheck --version 1.0.0

Create an instance of the PostmarkSpamcheck class:

var spamChecker = new PostmarkSpamcheck();

Then pass the email to be checked:

var spamResults = await spamChecker.GetScore("The raw email body");
var spamReport = await spamChecker.GetReport("The raw email body");

Then you can access the score or report:

Console.WriteLine("Score: {0}", spamResults.score);
Console.WriteLine("Report: {0}", spamReport.report);

Sample Usage

var email = Console.ReadLine();
var spamChecker = new PostmarkSpamcheckmarkSpamcheck();
var scoreTask = spamChecker.GetScore(email);
scoreTask.Wait();
var score = scoreTask.Result;
if (score.success) {
    Console.WriteLine("Score: {0}", score.score);
} else {
    Console.WriteLine("Failed: {0}", score.message);
}
var reportTask = spamChecker.GetReport(email);
reportTask.Wait();
var report = reportTask.Result;
if (report.success) {
    Console.WriteLine("Score: {0}\nReport: {1}", report.score, reportport.report);
} else {
    Console.WriteLine("Failed: {0}", reporteport.message);
}

About

.net core library for the postmark spamcheck service

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.