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

I am getting the same problem… if you have any luck solving the issue please kindly let me know.