Comorbidities, dietary supplement use, and prescription drug use may negatively (or positively) affect mental health in cardiovascular patients. Although the significance of mental illnesses, such as depression, anxiety, and schizophrenia, on cardiovascular disease is well documented, mental illnesses resulting from heart disease are not well studied. In this paper, we introduce the risk factors of mental illnesses as an exploratory study and develop a prediction framework for mental illness that uses comorbidities, dietary supplements, and drug usage in heart disease patients. Particularly, the data used in this study consist of the records of 68,647 patients with heart disease, including the patient’s mental illness information and the patient’s intake of dietary supplements, antibiotics, and comorbidities. Patients in age groups <61, gender differences, and drug intakes, such as Azithromycin, Clarithromycin, Vitamin B6, and Coenzyme Q10, were associated with mental illness. For predictive modeling, we consider applying various state-of-the-art machine learning techniques with tuned parameters and finally obtain the following: Depression: 78.01% accuracy, 79.13% sensitivity, 72.65% specificity, and 86.26% Area Under the Curve (AUC). Anxiety: 82.93% accuracy, 82.86% sensitivity, 83.35% specificity, and 88.45% AUC. Schizophrenia: 87.59% accuracy, 87.70% sensitivity, 85.14% specificity, and 92.73% AUC. Disease: 86.63% accuracy, 95.50% sensitivity, 77.76% specificity, and 91.59% AUC. From the results, we conclude that using heart disease information, comorbidities, dietary supplement use, and antibiotics enables us to accurately predict the mental health outcome.