Spam is the massive sending of messages over the Internet. This activity is carried out mainly for commercial and marketing purposes and causes a series of harm and conflicts of great relevance in the digital world. It is the responsibility of the Law to regulate this activity and protect the rights of the citizens. The objective of this article is to study this phenomenon, starting from its origin, establishing a clear definition, pointing out the most relevant types that have the greatest impact, and addressing the legal problems that derive from it. Through the analysis of documentary sources such as scientific articles, legislation, and practical guides related to spam, the different aspects of the legal systems of the most relevant countries have been reviewed to evaluate a single legal model that would allow facing the problem. Accordingly, a series of proposals and recommendations can be extracted to aim at a legal harmonization that is more adequate and more effective for the regulation of spam, as well as to point out the legal aspects at the international level that need to be improved.