In the modern era, communication through email is increased dramatically due to the cost-effectiveness, usage of contexts, application advertising, and so on. However, e-mails are considered a professional way of communication that helps both commercial and non-commercial organizations to share important documents, reports, and so on. Since e-mail acts as a global pathway, it attracts more intruders to create spam messages which result in storage consumption and virus attacks. To overcome these issues, an improved classification approach is introduced to classify spam emails from ordinary emails. The data is obtained from four benchmark datasets such as Enron, Lingspam, Spamassassin, TREC, and the pre-processing is performed using tokenization, lemmatization, and stemming. After this feature extraction is performed using Bag-of n-grams, latent dirichlet analysis (LDA), term frequency, and inverse document frequency (TF-IDF). Then the feature selection is performed using the proposed improved moth flame optimization (IMFO) algorithm and finally, the classification is performed using multi-class support vector machine (MSVM). The results obtained through experimental analysis show that the proposed IMFO-MSVM has achieved better accuracy of 98.68% whereas the existing semantic graph neural network (SGNN) and fuzzy rule based long short term memory (LSTM) have obtained accuracy of 97.87% and 97% respectively.