Blog

Contact Form Without a Backend: 5 Ways, With Code

Updated:

A contact form without a backend is a regular HTML form whose data goes to someone else’s server: a form service or CRM receives it, filters spam and forwards it to your inbox, Telegram or lead list. Here is how each option works, what the free plans include as of November 23, 2026, how to keep bots out, and a copy-paste form that submits with fetch and handles errors properly.

Why go without a backend

The traditional contact form is a PHP or Node script on your server that validates the fields and sends an email. That still works — but more and more sites have no server to run it on:

  • Static hosting. GitHub Pages, Cloudflare Pages, Netlify or an S3 bucket serve files as they are. There is nothing to execute when the form is submitted.
  • Static site generators and frameworks. Astro, Hugo, Eleventy, Jekyll or Next.js with static export. You could add a serverless function, but that is a deployment, secrets and logs for one form.
  • Site builders whose built-in form is too limited or locked behind a higher plan.
  • Shared hosting where PHP mail() is disabled or lands straight in spam.

Running your own handler also means owning spam protection, validation, email deliverability and data storage. A form service takes all of that off your plate; you keep the markup and the styling.

mailto: and why it fails

The shortest route is <form action="mailto:hello@example.com">. No account, no script — and that is exactly the problem:

  • the browser does not send anything; it hands off to the visitor’s email app. On a phone with no mail account or a work laptop that only uses webmail, the click goes nowhere;
  • there is no confirmation, so you never learn that a message was lost;
  • your address sits in the HTML in plain text, ready for spam harvesters;
  • no validation, no list of submissions and no idea where the visitor came from.

Keep a mailto: link in the footer as a fallback, but do not make it your form.

Form backend services compared

They all work the same way: sign up, get an endpoint URL or an access key, put it in the form’s action, and the service starts accepting submissions. The numbers below come from each vendor’s official pricing page as of November 23, 2026. Limits change, so check before you commit.

ServiceFree planPaid fromSpam protectionFile uploadsWhere leads go
Formspree50 submissions/month, unlimited forms, 30-day archive$15/month, or $10/month billed yearly (200 submissions)Spam filter, reCAPTCHA, _gotcha honeypot, domain restrictionPaid plansEmail (2 addresses on Free), dashboard
Web3Forms250 submissions/month, unlimited forms$12/month billed yearly (10,000 submissions)hCaptcha, botcheck honeypot; reCAPTCHA and Turnstile on ProProEmail, dashboard
Basin1 form, 50 submissions/month, 30-day retention$12.50/month billed yearly (250 submissions)Basic filtering100 MB on FreeDashboard, Zapier
FormSubmitFree, no published limitsNo paid plans listedreCAPTCHA on by default, blocked phrasesNot stated on the homepageEmail, webhook
SitecogNone: the trial does not include leadsBasic, $29 per 30 days, unlimited leadsHoneypot plus a one-time signed pass, no CAPTCHANoCRM and Telegram

Who each one suits: Formspree if you want a polished dashboard and thorough docs; Web3Forms if you expect more traffic and care about the free allowance; Basin if you need uploads without paying; FormSubmit for a quick prototype where an email is all you need. Older tutorials often recommend Getform — as of November 23, 2026 its pricing page redirects to a service called Forminit, so check the terms there.

Working code: HTML form + fetch

This form submits without a page reload, disables the button while sending, shows a status line and surfaces errors. If JavaScript fails to load, the browser still submits it the normal way through action. It targets Formspree — replace YOUR_FORM_ID with your form’s ID. The Accept: application/json header tells the service to answer with JSON instead of redirecting to a thank-you page.

contact.htmlhtml
<form id="contact" action="https://formspree.io/f/YOUR_FORM_ID" method="POST">
  <label>Name <input name="name" autocomplete="name" required></label>
  <label>Email <input name="email" type="email" autocomplete="email" required></label>
  <label>Message <textarea name="message" rows="5" required></textarea></label>

  <!-- Honeypot: invisible to people, tempting for bots -->
  <div class="hp" aria-hidden="true">
    <label>Leave this empty <input name="_gotcha" tabindex="-1" autocomplete="off"></label>
  </div>

  <label class="consent">
    <input type="checkbox" name="consent" required>
    I agree to the <a href="/privacy">privacy policy</a>
  </label>

  <button type="submit">Send</button>
  <p class="form-status" role="status" aria-live="polite"></p>
</form>

<style>
  /* Off-screen instead of display:none: some bots skip hidden fields */
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
</style>

<script>
  (function () {
    var form = document.getElementById('contact');
    var status = form.querySelector('.form-status');
    var button = form.querySelector('button');

    form.addEventListener('submit', function (event) {
      event.preventDefault();

      // Honeypot filled in: it's a bot. Pretend it worked and send nothing
      if (form.elements._gotcha.value) {
        status.textContent = 'Thanks! Your message has been sent.';
        form.reset();
        return;
      }

      button.disabled = true;
      status.textContent = 'Sending…';

      fetch(form.action, {
        method: 'POST',
        body: new FormData(form),
        headers: { Accept: 'application/json' }
      })
        .then(function (res) {
          return res.json().catch(function () { return {}; }).then(function (data) {
            if (!res.ok || data.success === false) {
              var text = data.errors
                ? data.errors.map(function (e) { return e.message; }).join(', ')
                : (data.message || 'status ' + res.status);
              throw new Error(text);
            }
            status.textContent = 'Thanks! We will get back to you within one business day.';
            form.reset();
          });
        })
        .catch(function (err) {
          status.textContent = 'Could not send (' + err.message + '). Email us at hello@example.com.';
        })
        .finally(function () {
          button.disabled = false;
        });
    });
  })();
</script>
  • The honeypot is moved off-screen rather than hidden with display:none, and taken out of the Tab order so keyboard and screen reader users never land in it.
  • The response is checked with res.ok. Formspree reports problems in an errors array; Web3Forms uses success: false with a message. The handler understands both.
  • A fallback address in the error message keeps the visitor from giving up if the service is down.

The same form on Web3Forms

Only the endpoint, the hidden key field and the honeypot name change. Keep the script, but check form.elements.botcheck.checked instead of _gotcha.value:

Changes for Web3Formshtml
<form id="contact" action="https://api.web3forms.com/submit" method="POST">
  <!-- Web3Forms access key: its docs say it is fine to keep it public -->
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <input type="hidden" name="subject" value="New message from the website">

  <!-- The Web3Forms honeypot is a checkbox named botcheck -->
  <input type="checkbox" name="botcheck" class="hp" tabindex="-1" autocomplete="off">
  ...
</form>

Embedding Google Forms

The zero-cost route is a Google Form embedded in your page. In the form editor open the “⋮” menu, choose Embed HTML, copy the <iframe> and paste it into your site. Responses are collected in Forms and can be linked to a Google Sheet.

It suits surveys, event sign-ups and internal questionnaires. As a lead form it has drawbacks:

  • it looks like Google, not like your site — fonts, spacing and the button are mostly fixed, and the iframe height often needs tweaking on mobile;
  • UTM parameters and the landing page are not recorded with the response;
  • a file upload question requires respondents to sign in to a Google account, and the files go to the owner’s Drive;
  • you get an email per response, but no instant alert in a messenger without extra scripting.

Sending leads to Telegram

Many teams would rather see leads in Telegram than in an inbox. The tempting shortcut is to call the Bot API straight from the browser:

Anti-patternjs
// Don't do this: anyone who opens the page source can read the token
fetch('https://api.telegram.org/bot123456789:AAE-secret-token/sendMessage', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ chat_id: 111222333, text: 'New lead' })
});

Without your own backend that leaves three options: a form service with a Telegram integration, a tiny serverless function (Cloudflare Workers, Vercel, Netlify Functions) that keeps the token, or a CRM that sends the alerts itself. All three are covered step by step in how to send website leads to Telegram.

Stopping spam

A public form starts collecting junk within days. Protection works best in layers, from invisible to strict.

Honeypot field

An extra field that people never see but naive bots fill in along with everything else. If it has a value, the submission is dropped silently. It costs nothing and adds no friction, so always include one. It will not stop bots that check field visibility, or humans spamming by hand.

Cloudflare Turnstile

Cloudflare’s CAPTCHA replacement, which usually passes without puzzles or clicks. According to the docs it is free with unlimited challenges, up to 20 widgets and 10 hostnames per widget on the free plan, and your site does not need to be on Cloudflare.

The catch for static sites: the widget gives the page a token, and a server must verify it by calling siteverify with your secret key. Tokens expire after five minutes and work once, and the secret must never appear in client-side code. So on a static site Turnstile only helps if your form service verifies it — Web3Forms, for example, supports it on the Pro plan.

Other safeguards

  • Allowed domains. Formspree and Web3Forms can restrict submissions to your own domains, so another site cannot burn your quota.
  • Require a way to reply. A message without an email or phone number is useless — make at least one mandatory.
  • Blocked phrases. FormSubmit, for instance, accepts a _blacklist field and rejects submissions that contain those phrases.
  • Double submits. Disable the button while the request is in flight, as the code above does.

Leads in a CRM, with UTM tags

An email tells you what someone wrote, not which campaign brought them in. To see the source on every lead, save the UTM parameters when the visitor lands and send them along with the form — the script for that is in our UTM tags guide. Then the lead needs a home where it will not get lost: a status, an owner, a history.

How Sitecog handles it

Sitecog connects to any site with one script tag. To turn a form into a lead source, add the data-crm-lead attribute; in React or Vue, call window.crmLead():

A form with Sitecoghtml
<script src="https://widget.sitecog.com/widget.js" defer></script>

<form data-crm-lead>
  <input name="name" placeholder="Name">
  <input name="email" type="email" placeholder="Email">
  <textarea name="message" placeholder="Message"></textarea>
  <button>Send</button>
</form>
  • name, phone, email and message are recognized by field name; other fields are kept as extra fields; passwords and card numbers are never sent;
  • a lead without a phone number or email is rejected;
  • spam protection is a honeypot plus a one-time signed pass, no CAPTCHA; doubtful leads are kept and flagged, and a double click never creates a duplicate;
  • Telegram alerts come from your own bot, to several people, each with their own quiet hours — the token lives on the server, not in the page;
  • each lead carries the channel, UTM tags, page and country when the visitor has allowed analytics;
  • statuses New, In progress, Done, Rejected and Spam, comments, and search by phone, email or name.

Leads are included in Basic ($29 per 30 days) and Pro ($79), with no limit on how many you receive. The 7-day trial is free but does not include leads. Details are on the forms and leads page. For visitors who would rather talk than fill in fields, the same plans include live chat, where files up to 10 MB can be shared.

What Sitecog does not do

  • email notifications for leads — alerts go to the CRM and Telegram only;
  • webhooks, integrations with other CRMs, or lead export;
  • file uploads in forms — text fields only;
  • a form builder — you write the form in your own HTML;
  • an automatic reply to the visitor;
  • a free plan with leads.

If any of these is a must-have, one of the form services above is the better fit.

Names, emails and phone numbers are personal data. Which rules apply depends on where you and your visitors are — GDPR for people in the EU, state privacy laws in the US, and local laws elsewhere. A few practices hold almost everywhere:

  • ask only for what you need to reply; a callback needs a name and a phone number, not a company size;
  • link your privacy policy next to the button and say who receives the data and why;
  • name the form service or CRM in that policy — the data is stored with them, often in another country;
  • never pre-tick a consent checkbox;
  • if you show a cookie banner, run scripts that store UTM tags or visitor IDs only after consent.

Which option to pick

SituationGood fit
Landing page, a few messages a week, email is enoughA form service on its free plan plus the code above
Survey, questionnaire or event sign-upEmbedded Google Form
Leads must arrive in TelegramA service with an integration, a serverless function or a CRM — never a token in the browser
Visitors send attachmentsA form service with file uploads
A team works the leads and needs to know which ad brought each oneA CRM with UTM tracking, such as Sitecog on Basic

Frequently asked questions

Can an HTML contact form send email without a backend?

Not on its own — HTML has no way to send mail. But you can point the form at a form service such as Formspree, Web3Forms or Basin. The service receives the submission, filters spam and emails it to you, so your site can stay fully static.

Why not just use a mailto: link?

mailto does not submit anything; it asks the visitor’s device to open an email app. If none is set up, nothing useful happens and you never find out. The address also sits in plain text in your HTML, where spam harvesters pick it up.

How much does a form backend service cost?

As of November 23, 2026, Formspree and Basin give you 50 submissions a month for free and Web3Forms gives you 250. Paid plans start at roughly $10–15 a month. In Sitecog, leads are part of the Basic plan at $29 per 30 days with no cap on the number of leads.

How do I accept file uploads without a server?

Pick a form service that stores files: on Formspree and Web3Forms that means a paid plan, while Basin includes 100 MB on its free plan. Google Forms supports uploads, but respondents must sign in to a Google account. Sitecog forms send text fields only; files can be shared through its live chat.

Will submission emails land in spam?

Sometimes, especially at first. Add the service’s sender address to your contacts, check the spam folder after a test submission and send leads to a second place too — Telegram or a CRM — so one filtered email does not cost you a customer.

Do I need a CAPTCHA on my contact form?

Often not. A honeypot field plus the service’s own filter is enough for many small sites. If spam keeps coming, Cloudflare Turnstile is free and rarely bothers people, but its token has to be verified on a server — on a static site that only works if your form service supports Turnstile.