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

Yes, a contact form