Spam has become one of the most significant problems for Internet communication and users today. The traditional filtering methods and signature-based spam blocking systems that have come into prominence recently fall short, as statistics demonstrate that spam further mounts up day after day. In this study, a new method is recommended to block spam mails. In this recommended method, a mail sending session is verified during mail envelope communication by adding small attachments to the simple mail transfer protocol, so spam mails can be blocked before leaving the sender domain or relay machine. Additionally, hijacked user accounts are able to be detected by statistical filtering software support, and spam mails coming from these users can be blocked and the account owners can be informed. According to the test results, 99.4% of the spam mails were able to be stopped by the proposed method, and the false positive problem was able to be solved and a significant decrease in the false negative percentages was ensured.