AI-built & no-code sites
I built a website with v0. How do I make the form work?
By the FormToMail team · Checked against official sources · Updated
v0 generates Next.js and React components, so you can either add a `fetch()` to a form endpoint in a client component (works on any deployment, including static export) or, if you deploy on a server such as Vercel, write a Server Action that sends email with your own provider and keys. The endpoint route takes one prompt.
| Option | Deployment | You maintain |
|---|---|---|
| fetch() to a form endpoint | Any | Nothing |
| Server Action + email API | Server (e.g. Vercel) | Email provider, keys, spam checks |
Prompt for v0
Make the contact form send its data to my form endpoint.
On submit, prevent the default, then POST new FormData(form) with fetch to
https://getformtomail.com/f/YOUR_FORM_ID
with the header Accept: application/json.
Every input needs a name attribute (name, email, message).
Add a hidden input named _gotcha (display:none, tabindex -1) as a honeypot.
If the JSON answer has ok: true, show "Thanks! We'll reply soon." and reset the form;
otherwise show the error text. Don't use a database or an email API key in the browser.Quick answers
I built a website with v0, how do I make the form work?
Ask v0 to POST the form to your endpoint (prompt above), then redeploy.
Can I use Server Actions instead?
Yes, on a server deployment. Not with output: 'export'; see Next.js static export forms.
Does the endpoint work in v0's preview?
Yes, CORS is open, so the preview domain can submit too.
What to do next
Create the endpoint for your v0 prompt.
Get your form endpointSources
Checked: . Prices, limits and features of other services change: confirm current values at the official links above. Product names belong to their owners; we are not affiliated with them.