How to add a contact form without a backend
You can collect enquiries and feedback on a static or file-based site - without writing server code, running a database, or renting a third-party form service.
Static and file-based sites are fast and cheap, but they hit one classic wall: forms. A form has to send its data somewhere, and a plain static host has nowhere to send it. The usual answers are to spin up a backend, or to hand the job to a paid third-party form service that puts its branding on your site and your visitors' data on someone else's server.
There is a middle path: a site engine that handles form submissions natively - so you get a working contact form with no separate backend and no external service.
What a form actually needs
Strip a contact form down and it needs three things:
- Fields and validation - name, email, message; check they are filled in and well-formed.
- Spam protection - so bots do not flood your inbox.
- Delivery - send each submission somewhere you will see it: an email, a file, or a webhook.
None of those require your server to run application code, if the engine serving your pages provides them.
The file-based approach
With a form-aware engine, you declare the form inside your page - the fields and a submit button - and point it at a delivery target. The engine renders a real HTML form with built-in anti-spam, accepts the submission, validates it, and delivers it. Your "backend" is the engine you were already using to serve pages.
Delivery options usually include:
- Email - the submission arrives in your inbox.
- A file - each submission stored for logging or offline processing, no email setup needed.
- A webhook - POST the data to another service (Slack, a CRM) if you want.
What you avoid
- No separate server to build, host, secure and keep alive just for a form.
- No third-party form SaaS - no per-submission fees, no external branding, no handing your visitors' messages to another company.
- No database - submissions can be stored as plain files.
Add one
lazysite has forms built in: write a :::form block in your page's Markdown, list the fields and rules, and bind it to a delivery handler - email, file, or webhook. It even accepts file and image attachments, with spam protection out of the box.
- Read the forms guide for the syntax and delivery options.
- See what else it does, or how it compares.