Spams are the textual context of the system which can damage the system. The basic problem is to protect the system from such type of unwanted files. To save from system form such kind of failures the authors design a system which can recognize the spams and can let the user know on the basis of training system. The first part consists of filling the ip address or header in the text box. In the ip.txt file they put the ip addresses of those countries or region which they want to be marked as spam and on the other hand in header.txt file they put the headers of all their contacts.