Xojo Plugin Requires Chilkat v11.0.0+
Xojo Plugin
Request a SpamAssassin score for a sample email
See more Email Object Examples
Submit a synthetic message to Postmark’s SpamCheck endpoint. The service receives the complete MIME you provide. Request a short result and check both the HTTP status and the API success field before reading the numeric score. SpamCheck API documentation.
Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
// Assumes Chilkat is unlocked. See Global Unlock Sample.
Dim email As New Chilkat.Email
email.From = "Workshop team <events@example.com>"
success = email.AddTo("Alex Rivera","alex@example.net")
If (success <> True) Then
System.DebugLog(email.LastErrorText)
Return
End If
email.Subject = "Workshop registration"
email.Body = "Your workshop registration is confirmed."
Dim request As New Chilkat.JsonObject
success = request.UpdateString("email",email.GetMime())
success = request.UpdateString("options","short")
Dim http As New Chilkat.Http
http.RequireSslCertVerify = True
Dim resp As New Chilkat.HttpResponse
success = http.HttpJson("POST","https://spamcheck.postmarkapp.com/filter",request,"application/json",resp)
If ((success <> True) Or (resp.StatusCode <> 200)) Then
System.DebugLog("SpamCheck request failed. HTTP " + Str(resp.StatusCode))
Return
End If
Dim result As New Chilkat.JsonObject
success = result.Load(resp.BodyStr)
If (success <> True) Then
System.DebugLog(result.LastErrorText)
Return
End If
If (result.BoolOf("success") <> True) Then
System.DebugLog(result.StringOf("message"))
Return
End If
System.DebugLog("SpamAssassin score: " + result.StringOf("score"))