Increasing number of unwanted e-mails has influence on users’ security in the Internet. Today spam e-mails can store potential malicious messages which e.g. can redirect user to fake sites. These messages recently appeared in social media. Filtering of this content is important due to minimize financial and branding costs. Traditional methods of spam filtering cannot be sufficient for present threats. We required new methods for constructing more dependable and robust antispam filters. Machine learning recently becomes very popular technique in classification methods. It has been successfully used in spam classification. In this paper we present some methods of machine learning for spam detecting. We would also like to introduce ways to solve the spam classification problem. We show that these methods can be useful in classification of malicious messages. We also compared developed methods and presented results in the experimental section.