Un-static

how-to

How to Add a Working Contact Form to a Bolt.new Site

Your Bolt site has a contact form that does nothing. Point it at an Un-static endpoint and messages land in your inbox, without a server function or an email API key.

Short answer

Bolt builds the front end of your site, and nothing on the published site receives a form post unless you write a server function for it. Point the form’s action at an Un-static endpoint and submissions reach your inbox by email. The free plan is enough for a contact form. Paste this prompt into Bolt to make the change.

Updated October 2026.

You asked Bolt for a landing page with a contact form. It looks right: name, email, a message box, a Send button, maybe a friendly “Thanks, we’ll be in touch!” when you click it. Then you send yourself a test message and nothing ever shows up.

Your prompt was fine. A form needs something on a server to receive what it sends, and the site Bolt published doesn’t have that part.

Why the contact form Bolt generated doesn’t work

Open the form component Bolt wrote and look at the <form> tag. You will usually find one of two things.

No action at all, with an onSubmit handler. The handler calls e.preventDefault(), maybe sets a submitted state to show the thank-you text, and stops there. preventDefault() is exactly what stops the browser from sending the form. The message never leaves the visitor’s screen.

A plain post to nowhere. Without an action, a form posts back to the page it’s on. Your published site is the front end Bolt built. There is no code behind that URL waiting to read a contact message, so the post is lost.

On Bolt, code that runs on a server is a server function, and you manage those from your project’s database settings in Bolt Cloud. Bolt’s own instructions for sending email go through one: you create a database, store a Resend API key as a secret named RESEND_API_KEY, publish to a custom domain, add that domain to Resend and wait for the DNS check to pass. Bolt’s help center says that check can take 10 to 20 minutes, sometimes a few hours. That’s the right setup for password resets and receipts. For “someone wants to talk to me” it’s a database, a third-party account, DNS records and a function you now maintain, and none of it filters spam.

If you publish to Netlify instead, Bolt’s Netlify page says Netlify “can’t host a database or a traditional backend.” Netlify does have its own form handling, but its build system finds forms by parsing your site’s HTML when the build completes. A form that React renders in the browser isn’t in that HTML, so Netlify’s docs ask you to add a hidden plain-HTML copy of the form with matching field names, plus a hidden form-name input in the React form. It works, and it ties your form to Netlify hosting.

A form backend skips all of that. Your form posts straight to an HTTPS endpoint we run, we filter the spam and email you the message. The site stays exactly what Bolt built.

Add a working contact form to your Bolt site

Step 1: Register a form endpoint

Go to forms.un-static.com/register-form. It asks for two fields and a checkbox:

  • Email address: where we send the submissions.
  • Success Destination: the page visitors land on after sending. Use your site’s address for now, for example https://your-project.bolt.host/, and point it at a thank-you page later (see step 5).
  • Privacy Policy and Terms of Service: tick the box to agree. The form won’t register without it.

You don’t need an account for this. We email you a confirmation link that is valid for 24 hours, and the endpoint only accepts posts after you’ve clicked it, so do that before you test. The page you land on after clicking shows your form URL with ready-made snippets, and the next email lists the same URL. Use the HTML tab: it’s a plain post, the same as the form this guide ends up with. The code at the end of that URL is your endpoint reference.

Step 2: Paste the prompt into Bolt

Copy the prompt below into Bolt’s chat. Replace YOUR_ENDPOINT_REFERENCE with your reference first, or leave it in and swap it in the code afterwards.

Step 3: Check the code Bolt wrote

Bolt changes code, and sometimes it changes more than you asked. Open the contact component and compare it with the example below. Check that the form has method="post" with the action pointing at your endpoint, and that every field has a name. If an onSubmit handler with preventDefault() survived, delete it.

Step 4: Publish and send a real test message

Click Publish (or Update if the site is already live). Bolt doesn’t push changes to a published site on its own, so a form that works in the preview can still be the old one on your live URL.

Open the live site, fill in the form with a real message and press Send. You first see our spam protection page on forms.un-static.com, which runs Google reCAPTCHA by default, and then you land on your Success Destination. The message arrives by email. Check your spam folder the first time.

Step 5: Send visitors to a thank-you page

Ask Bolt for a simple thank-you page (“Add a /thanks page that says the message was sent, with a link back home”), publish, and set its full URL as your Success Destination. You set that on the register form. To change it later, link the form to a free account and use Change success destination in the form’s dashboard.

The redirect is a dashboard setting, so there’s nothing to add to the form for it.

Step 6 (optional): Reply directly and add a honeypot

Two settings only exist once the form is linked to a free account. Open the form in your dashboard:

  • Set “Reply To” field: enter email. Our notification then uses the visitor’s address as Reply-To, so you hit Reply in your mail client and answer them. Until you set this, Reply goes to our default address, not to your visitor.
  • Set Honeypot Field (under Security Settings): enter website, the hidden field in the example below. Any submission with a value in that field is marked as spam and not sent to you. If you skip this, delete the hidden field from the form.

The free plan covers everything on this page: 25 submissions a month on a form without an account, 250 a month across your forms once it’s linked to a free account. See plans and pricing for the rest.

The prompt to paste into Bolt

Make the contact form submit to Un-static, a hosted form backend. Change only the form.
- Use a plain HTML form: method="post" action="https://forms.un-static.com/forms/YOUR_ENDPOINT_REFERENCE".
- Do not add Express, Nodemailer, Resend, a server function, an API route or a Supabase table. No backend code.
- Remove any onSubmit handler that calls preventDefault. The browser must do a normal form post.
- Every input and textarea needs a name attribute. Use name="name", name="email" and name="message".
- The email field must be type="email" and named exactly "email".
- Add a hidden honeypot input named "website" (tabIndex -1, autoComplete off, positioned off-screen, aria-hidden on its wrapper).
- Do not add captcha scripts or widgets. Un-static handles spam protection.

A later prompt such as “make the contact section prettier” can rewrite the component and bring an onSubmit handler back. To stop that, keep the rule in the project’s Knowledge: click the gear icon at the top center of your project, choose All project settings, then Knowledge in the left menu. Bolt applies Knowledge to every prompt in that project. One line is enough: “The contact form posts directly to https://forms.un-static.com/forms/YOUR_ENDPOINT_REFERENCE. Never add a submit handler or backend code for it.”

Using Cursor, Claude, ChatGPT or Copilot on the same code? The page for AI agents has our general integration prompt and the machine-readable docs those tools can read.

What the form should look like

Bolt writes your site as JavaScript components. In a React project, which is what you have when the files end in .jsx or .tsx, a working contact form is this:

export default function ContactForm() {
  return (
    <form
      method="post"
      action="https://forms.un-static.com/forms/YOUR_ENDPOINT_REFERENCE"
    >
      <label htmlFor="name">Name</label>
      <input id="name" name="name" type="text" required />

      <label htmlFor="email">Email address</label>
      <input id="email" name="email" type="email" required />

      <label htmlFor="message">Message</label>
      <textarea id="message" name="message" rows={6} required />

      {/* Honeypot: hidden from people, filled in by many bots. */}
      <div aria-hidden="true" style={{ position: 'absolute', left: '-10000px' }}>
        <label htmlFor="website">Leave this field empty</label>
        <input id="website" name="website" type="text" tabIndex={-1} autoComplete="off" />
      </div>

      <button type="submit">Send message</button>
    </form>
  );
}

Keep whatever classes Bolt put on the elements; styling doesn’t affect the post. What does:

  • name on every field. The browser only sends fields that have a name, and the name is the label you see in the email. An id alone sends nothing.
  • A field named email. That’s the field you point the Reply To setting at in step 6.
  • No onSubmit that prevents the default. This is the version Bolt often writes, and it’s the one to remove:
// Sends nothing: preventDefault() cancels the post.
<form onSubmit={(e) => { e.preventDefault(); setSubmitted(true); }}>

Want the message to send without leaving the page? There is an /ajax route on the same endpoint for JavaScript submits, but it needs a form linked to an account with your own captcha keys, because your page has to show the captcha widget itself. The AJAX how-to covers it. For a contact form, the plain post above is less code and less to break.

Spam protection

A contact form on a public URL gets found by bots, usually within days. Every new endpoint starts on Google reCAPTCHA through our own protection page, the one you saw during your test, so there is no captcha code to add in Bolt. On top of that, submissions with phrases on our spam list are filtered out and repeated posts from one address are rate limited.

Once the form is linked to a free account, Security Settings lets you pick the provider per form: Google reCAPTCHA, Cloudflare Turnstile, hCaptcha or Off. Protecting your form with Cloudflare Turnstile walks through switching. The honeypot from step 6 sits next to it. None of this is a paid feature.

Frequently asked questions

Does Bolt.new have a built-in contact form backend? Not as such. Bolt can send email through a server function with a provider like Resend. That route needs a Bolt database with the API key stored as a secret, and Resend has to verify your sending domain before mail goes out. For a contact form, a plain form posting to a form backend does the same job with no backend code.

Will this work if I deploy my Bolt site to Netlify instead of Bolt hosting? Yes. The form posts to forms.un-static.com, not to your host, so it works the same on a .bolt.host address, a custom domain or Netlify. You can also move hosts later without touching the form.

Why does my form work in the Bolt preview but not on the live site? Most often the live site is an older version. Publishing doesn’t update automatically after you change the project, so click Update in Bolt’s publish menu after Bolt edits the form. If it’s current, check that you confirmed the email from step 1: an endpoint that isn’t confirmed yet doesn’t accept posts.

Do I need an Un-static account? No. A registered form works without one, with up to 25 submissions a month. A free account raises that to 250 a month across your forms and adds the dashboard settings: Reply To, the honeypot, the captcha provider and changing the Success Destination.

Is my email address visible in the page source? No. Your page only contains the endpoint URL. The address we deliver to is stored with us, so scrapers reading your Bolt site’s code don’t find it.

If your test message never arrives, write to us with your endpoint reference and we’ll look it up.