The exposure to unpleasant emotions or content in messages can lead to health complications, including high blood pressure and several heart-related disorders. Hence, the identification of unpleasant emotions in written content can serve as a beneficial instrument in addressing certain health-related issues. Emotions can be communicated through diverse modalities, including written text, spoken language, and facial gestures. The objective of this work is to create a Text-based emotion detection system that possesses the capability to accurately identify emotions within text messages. The use of message filtering mechanisms that detect and block content containing negative emotions can serve as a preventive measure to shield users from accessing messages that have the potential to adversely impact their well-being. Conversely, messages that convey positive or neutral emotions remain accessible for comprehension. In order to accomplish this objective, a combination of three machine learning algorithms, namely Naive Bayes, Support Vector Machine, and Logistic Regression, were employed, adhering to the CRISP-DM approach. The Logistic Regression technique achieved the greatest accuracy rate of 98.4% and was employed in the construction of the detection system. The Graphical User Interface (GUI) of the system was developed utilizing HTML and CSS, with the integration of diverse components to establish a comprehensive and operational interface for the user.