Why your static website's contact form does not send anything, and three ways to fix it

Your static site has no server-side handler to receive a form post unless you add one or connect an external service. HTML draws the form; it does not deliver messages. JavaScript that displays a success message without submitting the fields only changes what you see.

If your submit handler calls preventDefault() and never sends a request, remove that handler before trying these examples.

Choose one of these three fixes.

  1. Use your hosting provider's built-in forms

Some hosting providers detect forms in your deployed HTML and collect the submissions for you. Enable that feature in your host's settings, put a form like this in the generated HTML (the attributes shown are one host's syntax; check your host's documentation for its own), and redeploy:

<form name="contact" method="POST" data-netlify="true">
  <input name="name" placeholder="Your name" required>
  <input type="email" name="email" placeholder="Your email" required>
  <textarea name="message" placeholder="Your message" required></textarea>
  <button type="submit">Send</button>
</form>

Generate a free form

No card needed. 100 messages a month free.

Then look in your host's submissions area for the result; email notifications need configuration. This example depends on that hosting feature.

  1. Connect a hosted form backend

Choose a backend that accepts ordinary HTML form data. Register your site's domain if it requires an allowed-site setting, configure the destination inbox, and complete any verification.

Replace your-endpoint-address with the actual submission endpoint issued for your form:

<form action="your-endpoint-address" method="POST">
  <input name="name" placeholder="Your name" required>
  <input type="email" name="email" placeholder="Your email" required>
  <textarea name="message" placeholder="Your message" required></textarea>
  <button type="submit">Send</button>
</form>

Use the field names your chosen backend expects. This uses normal browser submission. If you later switch to JavaScript fetch, the backend must also allow cross-origin requests from your site.

  1. Add a small serverless function

The function in these steps receives your form messages and saves them. Emailing you is extra setup that these steps do not cover. Menu names differ between platforms, so the words below are what to look for, not exact labels.

a. Create a function. Open your platform's dashboard and look for Functions, Serverless or Create Service. Follow its beginner setup guide.

b. Create storage. Find Storage or Key-Value Store and create a store for the messages. In the function's settings, look for Bindings and connect the store, giving the connection a name such as inbox.

c. Set up the function. Follow the platform's guide so that it accepts form submissions sent with POST, reads the name, email and message fields, rejects a submission with a missing required field, and saves each valid message under an identifier that cannot repeat.

d. Deploy it. Choose Deploy or Publish, then find the function's public address under Overview or Endpoints.

e. Connect your form. Put that address in your form's action attribute, keep method="POST", and publish your updated website.

f. Test it. Send a message containing a unique phrase. You should get a successful response and find that exact phrase in the storage records.

g. Protect it. Before public use, add server-side validation, message-size limits and spam protection.

Two common mistakes: forgetting to connect the storage to the function, and showing a success message before the message is confirmed saved.

Confirm it really arrived

Response status: Inspect the submission in your browser's Network panel. Check its status and response body; a success message alone proves nothing.

Spam folder: If email delivery is configured, check the destination inbox and spam folder.

Test submission: Send a unique phrase, then find that exact phrase in the submissions dashboard, stored record, or delivered email.

I work on a form backend. None of these three fixes requires our service.

Generate a free form ยท See plans · Claim a free endpoint

Form still not sending? Send us your site address for a free check, or let us set up one form on Lamofel for USD 49 one time. See how set-up works.