Make your Lovable contact form actually send
Lovable is excellent at producing a polished React front end. What it can’t give you is a durable place for submissions to land: email delivery, spam filtering, and storage still have to live somewhere. Instead of standing up Supabase + an edge function + Resend just to catch a contact form, paste one endpoint.
Lovable generates the form UI but not the backend that receives it, so the submit button does nothing. Point the form at a MakeTheForm endpoint: it accepts the POST, filters spam, emails you each submission, and stores it in a searchable inbox: no Supabase table or Resend key to wire up.
The minimal integration
Lovable apps are React. This is the whole integration, a fetch to your endpoint with success and error handling. Keep Lovable’s markup and styling; only the submit handler changes.
import { useState } from 'react';
export function ContactForm() {
const [status, setStatus] = useState({ state: 'idle' });
async function handleSubmit(event) {
event.preventDefault();
const form = event.currentTarget;
setStatus({ state: 'submitting' });
try {
const response = await fetch('https://mtform.co/f/your-form-key', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(Object.fromEntries(new FormData(form))),
});
const result = await response.json();
if (!response.ok) {
throw new Error(result.error?.message ?? 'Unable to send your message.');
}
form.reset();
setStatus({ state: 'success' });
} catch (error) {
// Entered values stay put; we only reset on success.
setStatus({ state: 'error', message: error.message });
}
}
return (
<form onSubmit={handleSubmit}>
<input name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required />
{/* Spam trap: hidden from people, tempting to bots. */}
<input
type="text"
name="_mtf_honeypot"
tabIndex={-1}
autoComplete="off"
aria-hidden="true"
style={{ position: 'absolute', left: '-9999px' }}
/>
<button type="submit" disabled={status.state === 'submitting'}>
{status.state === 'submitting' ? 'Sending…' : 'Send'}
</button>
{status.state === 'success' && <p role="status">Thanks. We got your message.</p>}
{status.state === 'error' && <p role="alert">{status.message}</p>}
</form>
);
}Drop in as a component, or copy the handler into your existing form. Disables the button while submitting and preserves entered values on error.
Step by step
- 01
Create the endpoint
Sign up for MakeTheForm and create a form. You immediately get a public endpoint URL (an address, not a secret) and an inbox.
- 02
Paste the prompt into Lovable
Drop the prompt above into Lovable’s chat with your endpoint URL. Lovable keeps its own design and only rewires the submit handler to POST to MakeTheForm.
- 03
Verify your recipient
Click the link in the verification email once. Until then submissions are still stored. They just don’t notify, so nothing is lost while you set up.
- 04
Publish and test
Publish the Lovable app, submit the form, and watch it appear in your inbox and by email with the sender in Reply-To.
Copy this prompt into your AI builder
Paste it as-is. It pins the exact endpoint, spam field, and success/error behavior so the agent wires the form correctly instead of inventing a backend or leaking a key.
In this Lovable project, connect the existing contact form to this MakeTheForm endpoint:
https://mtform.co/f/your-form-key
Requirements:
- Submit with fetch as JSON (Content-Type: application/json). Do NOT add Supabase, an edge function, or any backend. This endpoint is the backend.
- Keep the current design and component structure exactly. Only add the submit handler.
- Disable the submit button while the request is in flight.
- Treat any HTTP 2xx as success: show an inline success message and reset the form.
- On failure, show the message from the JSON response at error.message and preserve what the user typed. Do not clear the form on error.
- Add a hidden honeypot input named exactly "_mtf_honeypot", visually hidden with position:absolute;left:-9999px, tabIndex={-1}, autoComplete="off", aria-hidden="true". Never display:none it, never make it required.
- This endpoint URL is public and safe in client code. Do NOT create, request, or reference an API key, and do not move it into an environment variable.Common pitfalls
Letting Lovable add Supabase for a contact form
It will happily scaffold a database table and an edge function. For a contact form that’s a backend to maintain, secure, and rate-limit. The prompt above tells it not to. The endpoint already is the backend.
Treating the endpoint like a secret
The public form key is an address. It belongs in client code. If Lovable tries to hide it in an env var or asks for an API key, that’s a sign it invented server logic you don’t need.
Troubleshooting
| Symptom | What is happening | Fix |
|---|---|---|
| nothing happens | The button is wired to Lovable’s default handler, which never posts anywhere. | Re-run the prompt; confirm the handler calls fetch(endpoint) and that the endpoint URL is exactly yours. |
| 403 | Allowed-domains is on and your published Lovable domain isn’t listed. | Add your Lovable/custom domain in the form’s Spam settings, or leave the form in public mode. |
| no email | The recipient address isn’t verified yet. | Open the verification email once. Submissions received meanwhile are already saved in your inbox. |
Frequently asked questions
→Does Lovable have built-in form handling?
No. Lovable generates the form’s UI, but submissions need a backend to receive, filter, and deliver them. That’s what a form endpoint like MakeTheForm provides. Without you writing or hosting server code.
→Do I need Supabase to handle a Lovable form?
Not for a contact or lead form. Supabase is worth it when you need your own database and auth. To simply receive submissions by email and keep a searchable copy, one endpoint is less code and less to maintain.
→Is it safe to put the endpoint in my Lovable app’s code?
Yes. The public form key is a non-secret address, designed to sit in client-side code. Your destination email is never exposed in the page source.
Keep going
- Form backend for AI-built websites
- Bolt.new contact form backend
- v0 form handling
- React contact form, in depth
Last reviewed July 23, 2026
Ship this form for real
Create an endpoint, paste it in, and watch the first submission land in your inbox, in under three minutes.
Create free endpoint