---
title: "Aspose::Email::AntiSpam::SpamAnalyzer class"
url: "https://reference.aspose.com/email/cpp/aspose.email.antispam/spamanalyzer/"
product: "Aspose.Email for C++"
description: "Class which allows applications to detect spam e-mails with self-learning Bayesian filter."
---


## SpamAnalyzer class

Class which allows applications to detect spam e-mails with self-learning Bayesian filter.

## Constructors

| Name | Description |
| --- | --- |
| [SpamAnalyzer (3 overloads)](./spamanalyzer/) | Initialize a new instance of the Aspose::Email::AntiSpam::SpamAnalyzer class. |

## Methods

| Name | Description |
| --- | --- |
| [get_Filter](./get_filter/) | For testing only. |
| [LoadDatabase (2 overloads)](./loaddatabase/) | Loads Bayesian database from stream. |
| [Reset](./reset/) | Clears all statistics (Bayesian database). |
| [SaveDatabase (2 overloads)](./savedatabase/) | Saves the Bayesian database to stream. |
| [Test](./test/) | Analyses the message and returns the probability of the message being spam. |
| [TrainFilter (3 overloads)](./trainfilter/) | Learns from the specified messages as from spam or non-spam source. |

