How do I create a contact form that allow me to block spams by collecting their IP address?

I did some checking and there really isn’t anything we can do.

What are you getting the spam from? A contact form?