How to create a custom post while submitting the form

Which plugin you’re using for the contact form? It looks likeyou’re thinking about Gravity forms. You can create it with a custom function when the action gform_after_submission is fired –

For Contact form 7, there is another hook, see here: wpcf7_before_send_mail, wpcf7_mail_sent

for the other plugins you should have a look yourself.

If it’s too complicated, go for plugin solution. I have found this one for Gravity forms but haven’t tried it personally.