Form to email

How do I get a contact form people fill out to be sent to my email address?

The mechanics are pretty tricky to outline and describe so you will want to do some reading on the topic.

https://www.startpage.com/do/dsearch?query=form+mail

It starts with a CGI (Common Gateway Interface) on your server. This is the URL that will be embedded in the action attribute of your form element.

<form action="URL_TO_CGI_SCRIPT">

When a user clicks the Submit button on the form, the client bundles all the POST data into a single request and sends it to the server, where the message is parsed into an email and sent along to the specified recipient(s).

There are serious technical and security concerns that cannot be ignored. Hackers will try to pass executable code through your form in an attempt to gain access to the server. Best advice would be to let a service handle your webform submissions so your own site is not compromised.

2 Likes