I need to check the spam score of emails before sending them, to evaluate if should be sent or not. For this we can use the nice API of Postmark that actually does is to put Spamassasin in a REST API. It’s Free 😉
In this example I am showing you how to do it with PHPMailer, since you need to send the RAW email, with headers included to evaluate the spam score.
Code: