That's where we got the idea of proof-of-work in the 90s [1]. The problem is that this makes legitimate use cases like mailing lists very expensive, while providing little protection against spam from botnets.
[1] https://en.wikipedia.org/wiki/Hashcash