The reason you seem to be getting down votes is that there is no proper way to do what you want.
Either you allow anonymous messages, or you get a working block system (and even most authenticated messaging systems have a hard time getting a 100% safe blocking mechanism).
To be able to block someone, you need a way to uniquely identifying them. IP addresses are not a good option, since even without using proxies, someone’s IP is not fixed over time and it doesn’t uniquely identify them. People working in the same company might appear to have the same IP to your application.
Someone sending a message while visiting a friend’s house, using their WiFi would come from the same IP as that friend.
Anyway, long story short, if you allow anonymous sending of messages, you’ll never be able to adequately block anyone.
solved Block system in anonymouse chat system [closed]