SpamAnalyzer.TrainFilter

TrainFilter(MailMessage[], MailMessage[])

Learns from the specified messages as from spam or non-spam source.

public void TrainFilter(MailMessage[] ham, MailMessage[] spam)
ParameterTypeDescription
hamMailMessage[]The array of MailMessage objects that is non-spam for training the Bayesian filter.
spamMailMessage[]The array of MailMessage objects that is spam for training the Bayesian filter.

Exceptions

exceptioncondition
ArgumentNullExceptionIf ham or spam is null.

See Also


TrainFilter(MailMessage, bool)

Learns from the specified message as from spam or non-spam source.

public void TrainFilter(MailMessage message, bool isSpam)
ParameterTypeDescription
messageMailMessageA reference to the MailMessage object representing the message to train the Bayesian filter.
isSpamBooleanTrue if the message is a spam; false if it’s a legitimate message.

Exceptions

exceptioncondition
ArgumentNullExceptionIf message is null.

See Also


TrainFilter(string, bool)

Learns from the specified string as from spam or non-spam source.

public void TrainFilter(string text, bool isSpam)
ParameterTypeDescription
textStringA string value to train the Bayesian filter.
isSpamBooleanTrue if specified text is a spam; false if it’s a legitimate text.

Exceptions

exceptioncondition
ArgumentNullExceptionIf text is null.

See Also