The exponential rise in spam and phishing emails presents a critical challenge to the privacy, security, and efficiency of users. This research introduces a deep learning model with enhanced performance over existing top-tier studies. The model's strength lies in its ability to precisely classify emails into three distinct categories: legitimate (ham), unsolicited (spam), and malicious (phishing). This research employs two sophisticated feature selection techniques to enhance classification accuracy: Principal Component Analysis (PCA) and Particle Swarm Optimization (PSO). These techniques are instrumental in identifying and extracting the most informative features from the data, which are critical for the task of categorizing emails effectively. Rigorous testing has elevated the PSO-enhanced model to a position of excellence, with an accuracy rate of 99.60%. This high degree of accuracy is a testament to the strength of deep learning in the arena of email filtering. The research confirms the value of feature selection in augmenting deep learning models, laying the groundwork for innovative defenses against email threats. The study's insights offer optimistic prospects for the advancement of more resilient email systems. Utilizing the substantial computational prowess of deep learning and the precision of feature selection techniques like PCA and PSO, the research charts a course for significantly reducing spam and phishing email incidents. As such, this research marks a significant stride in digital security, equipping stakeholders with a powerful asset in the ongoing effort to safeguard against cyber threats.