The Internet of Things (IoT) connects a range of things, including sensors, physical devices, controllers, and intelligent computer processors. Physical objects with the ability to organize and control independently are referred to as smart devices in the IoT architecture. These smart devices are becoming an integral aspect of human life, from smart homes to large industrial and organizational sectors. Despite the numerous benefits of email regarding information generation and reminders based on predefined regulations, spam emails sent by thingbots pose a potential concern in the Internet of Things. Recently, several studies have used machine learning systems and deep learning models to detect email spam in the internet of things. The presence of unbalanced data, which impacts classification accuracy, is one of the challenges associated with spam detection. In this study, bidirectional gated recurrent unit (BiGRU) and Convolution neural network (CNN) are combined with the Non-dominated Sorting Genetic Algorithm-II (NSGA II) multi-objective optimization method to effectively address imbalance problems. This solution utilizes the two classification criteria TPR and FPR, as NSGA II objective functions and is capable of resolving the imbalance problem in email spam data. The proposed technique is evaluated using the Enron dataset, and the results indicate that the proposed method is more accurate at detecting spam than other baseline methods.