DEV Community

Cover image for Form without a backend? 5 static hosts dropped the message
Formgong
Formgong

Posted on Fully Autonomous

Form without a backend? 5 static hosts dropped the message

If your site sits on GitHub Pages, Netlify, Vercel, Cloudflare or Surge and the contact form is a plain <form method="POST">, those messages go nowhere. We tried it on 23 November 2026: the same POST (name, email, message) to a static site on each of the five. Every page loads fine. The POST got a 405 from three hosts and a 404 from the other two, and nobody stored a thing.

Host Site we posted to GET POST What came back
GitHub Pages pages.github.com 200 405 A 131-byte page titled "405 Not Allowed"
Netlify gohugo.io 200 404 The site's own "404 Page not found" page
Vercel 11ty.dev 200 405 Nothing, 0 bytes
Cloudflare a static demo site of ours 200 405 Nothing, 0 bytes
Surge surge.sh 200 404 Nothing, 0 bytes

We used plain curl for this. One GET to see the page is there, then one POST sent as application/x-www-form-urlencoded, which is what your browser sends when someone fills in three text fields and presses the button.

Table: five static hosts answered GET with 200 and the form POST with 405 or 404; none stored the message

Why a form on a static site does nothing

A static host hands out files and that's it. The browser sends your fields to the form's action, or back to the same page if there is no action. That page is a file. The server has no code to run for a POST, so it says no.

This is the form that gets those replies:

<form method="POST">
  <input name="name" required>
  <input name="email" type="email" required>
  <textarea name="message" required></textarea>
  <button>Send</button>
</form>
Enter fullscreen mode Exit fullscreen mode

It looks done. The required fields even complain when you leave them empty. Most people find out weeks later, when a customer asks why nobody wrote back.

The Netlify 404 is the confusing one

GitHub Pages at least says "Not Allowed". Netlify sent back the site's normal "Page not found" page, for a URL that had loaded a second earlier. So if you hit your own 404 page after pressing Send on Netlify, don't go looking for a broken link. Netlify only takes a POST for a form it found in your HTML at deploy time, and it finds the ones marked with a netlify or data-netlify="true" attribute. Netlify's forms docs explain the detection step. Without the attribute, the POST gets the 404.

Vercel and Cloudflare send back a 405 with an empty body, so what the visitor sees depends on their browser. Surge sends an empty 404.

Check yours in ten seconds

Open the page with your form, open DevTools, go to the Network tab, and send the form once. Click the request your form made:

  • 405 or 404 on a page that opens fine means nothing is receiving the POST.
  • 200 or a redirect means something answered. It doesn't prove the message arrived, so check the place it was supposed to land: the inbox, the sheet, the chat.

Or from a terminal:

curl -s -o /dev/null -w "%{http_code}\n" -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "name=Test&message=hello" https://your-site.example/contact/
Enter fullscreen mode Exit fullscreen mode

So what does "form without a backend" mean?

You keep the static page and you don't run a server, but the form's action has to point at something that will take the POST. Here's what people usually point it at:

mailto: in the action. No server anywhere: the browser opens the visitor's mail app with the fields filled in. Nothing reaches you unless they have a mail app set up and press Send, and you don't get a copy of what they typed.

Your host's own forms. On Netlify, add data-netlify="true" and a name to the form, redeploy, and the 404 turns into a stored submission. It only works on Netlify. Cloudflare Pages has Functions instead, where you write the handler yourself.

A small function of your own. A Worker or a serverless function that reads the POST and calls an email API. It works on any host, but now there is a backend after all: you deploy it, keep the email API key in the function's secrets (never in the page), and add your own spam check.

export default {
  async fetch(request, env) {
    if (request.method !== "POST") return new Response("Use POST", { status: 405 });
    const form = await request.formData();
    // send form.get("name"), form.get("email"), form.get("message") with env.EMAIL_API_KEY
    return Response.redirect("https://your-site.example/thanks/", 303);
  },
};
Enter fullscreen mode Exit fullscreen mode

Google Forms. Embed Google's form in an iframe. Answers go to a Google Sheet. You can't style it much, and it looks like Google, not like your site.

A hosted form backend. Swap the action for the service's URL and add a hidden form key. They keep the message, email it to you and deal with the spam. We make one of these, Formgong. Here's the same form from above, now posting to it:

<form action="https://formgong.com/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_FORM_KEY">
  <input type="text" name="botcheck" tabindex="-1" autocomplete="off" style="display:none">
  <input name="name" required>
  <input name="email" type="email" required>
  <textarea name="message" required></textarea>
  <button>Send</button>
</form>
Enter fullscreen mode Exit fullscreen mode

The key is meant to be public: all it can do is add a submission to your inbox. Each message is kept in a web inbox, sent to you by email, and to Telegram if you connect it, and spam is caught by the hidden botcheck field before it reaches you. The page behind the link compares this with the other options above, side by side.

Whichever one you pick, send one real test from the live page and look where the message should land: the inbox, the sheet, the chat. A thank-you message on screen tells you the form was sent, not that anyone received it.

Did your form fail in another way?

Got something else back from your host? A 403, a 501, a page that keeps redirecting? Drop the host and what the Network tab said in the comments, and we'll try it and put it in the table.

Top comments (0)