The document proposes an efficient algorithm using machine learning techniques to filter electronic spam, which poses significant challenges for major companies due to its economic impact and resource consumption. Three machine-learning algorithms including multilayer perceptron, decision tree classifier, and naïve Bayes are discussed for their low error rates and high effectiveness in distinguishing spam from valid emails. The study evaluates the classifiers' accuracy based on factors like valid recognition rate and false positive rates, concluding that the multilayer perceptron outperforms the others in efficiency.