how-to
How to Add a Working Contact Form to a Website Built With Claude
The contact form on the page Claude built for you looks finished and sends nothing. Export the page, point the form at an Un-static endpoint and host the file, and messages land in your inbox.
Short answer
A page Claude builds in chat is an artifact. No Anthropic page we read describes a way for its form to email you, and its host’s browser policy, as far as we can see, refuses form posts to outside addresses. Export the page as HTML, point the form’s action at an Un-static endpoint and host the file anywhere. Submissions then reach your inbox by email, and the free plan is enough for a contact form. Paste this prompt into Claude before you export.
Updated November 2026.
You asked Claude for a website with a contact form. It looks right: name, email, a message box, a Send button, maybe a “Thanks, we’ll be in touch!” when you click it. Then you send yourself a test message and nothing arrives.
Your prompt was fine. The problem is where the page lives, so fixing the form means moving the page out of Claude.
Why the form in a Claude artifact can’t be your contact form
Three separate things stand in the way.
There is nothing behind the form. Anthropic’s Claude Code docs describe an artifact made there as “one self-contained page with no backend”. The help center pages we read don’t use those words for chat artifacts, and none of them describes a way for a form in one to email you. A form needs something on a server to receive what it sends. The form Claude writes often has no action, just a submit handler that calls preventDefault() and shows a success message. preventDefault() is exactly what stops the browser from sending the form, so the message never leaves the visitor’s screen.
The sandbox host’s policy appears to refuse outside addresses. Adding our address to the form inside the artifact doesn’t help, as far as we can see. We read the response headers of www.claudeusercontent.com on 4 November 2026. Anthropic’s Claude Code docs name the claudeusercontent.com domain as the artifact sandbox. The Content Security Policy that host serves only allows form posts back to itself, and allows fetch calls only to itself and a few script CDNs. forms.un-static.com is on neither list, and neither is any other form service. This is our reading of the policy on that host, not a statement from Anthropic, and we read it from the host and not from inside a live artifact.
The link isn’t a public website. Anthropic’s article on sharing artifacts says: “Everyone needs a Claude account. People without one can’t open a shared artifact, even with the link.” The exception is a legacy artifact, which the help center defines as one made in a chat before September 16, 2026, and which stays open to anyone once published. A visitor without a Claude account can’t open a newer artifact made in a chat.
A custom artifact can save what people enter, on paid plans. That still isn’t a public contact form: your visitors would need a Claude account to reach it, and Claude Academy says the parts that save entries stop working in the exported copy.
So the page has to leave Claude. As a plain HTML file on an ordinary host, the form can post straight to an HTTPS endpoint we run. We filter the spam and email you the message.
Add a working contact form to your Claude 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. It has to be a full web address. Use the address your site will have if you know it, for example
https://your-name.github.io/. If you don’t, do steps 3 and 4 first with the page as it is, note the address, and come back. Changing it later takes a free account (step 7) or a new endpoint. - Privacy Policy and Terms of Service: tick the box to agree. The form won’t register without it.
You don’t need an account. We email you an activation link that is valid for 24 hours, and the endpoint only accepts posts after you click it. Until then, a post gets a 404.
The page you land on shows your form URL, and the next email lists it again. The code at the end of that URL is your endpoint reference. That page also offers ready-made snippets. Use the HTML tab or the form on this page, since a plain HTML form is what you’re exporting.
Step 2: Change the form
Before you export, go back to the same chat and paste the prompt below with your reference filled in. Then compare the result with the example.
Don’t test it in the artifact preview. What happens there says nothing about the hosted form.
Step 3: Export the page as HTML
Open the artifact’s title menu, choose Export and pick HTML. Claude Academy’s tutorial on custom artifacts describes this route. If Claude made your page with the Design template, the same choice is called standalone HTML, next to a .zip of website files. A legacy artifact has its download control at the top of the artifact panel instead.
If what you get is React or JSX and not a plain page, go back to the chat and ask Claude for a single plain HTML file. Name the file index.html.
Already exported, or prefer to edit the file yourself? Open the HTML file in a text editor, find the <form> tag and make it match the example. Delete any submit handler that calls preventDefault(), and check that every field has a name. If you can’t find a <form> tag in the file, use the prompt in Claude instead and export again.
There are now several copies of your page
The one in the chat, a published one if you made one, the file you exported and, after step 4, the one on your host. What you change in Claude doesn’t reach the file or the host. After any later edit in Claude, export again and upload again, and check the form still matches the example.
Step 4: Host the file
- Vercel Drop takes a single file by drag and drop. The deployment is temporary and shows a countdown. To keep it, claim the project with a free account before the countdown ends.
- Netlify Drop takes a folder, so put
index.htmlin one and drag the folder in. No account needed to start. We haven’t checked how long a drop without an account stays up, so sign up if you’re keeping it. - GitHub Pages publishes static files you push to a repository. On a free account the repository must be public.
- Cloudflare Pages direct upload takes a zip file or a single folder.
Claude Academy also describes deploying an artifact’s code through a Netlify connector, if you have that connector set up.
Whichever you choose, check that the <form> tag has no netlify or data-netlify attribute. Those turn on Netlify’s own form handling.
Step 5: Send a real test message
Open your hosted address, not the artifact. 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.
A 404 means the endpoint isn’t activated yet. If the activation link has expired, register again with the same email and destination, and we send a new link for the same endpoint. Opening the endpoint URL in a browser is no test of your form: once activated, it only shows an info page.
Step 6: Send visitors to a thank-you page
Ask Claude for a simple thank-you page (“Make a page that says the message was sent, with a link back to my homepage”), export it, name it thanks.html and put it next to index.html. Host the folder again and check the address your host shows. It can change when you upload again without an account. Use the full URL of that page as your Success Destination.
You set that on the register form. To change it later, link the form to a free account (step 7) and use Change success destination in the form’s dashboard. Registering again with a new destination also works, but it gives you a new endpoint URL, so the form in your page would have to change too.
Step 7 (optional): Link a free account
Create the account first: it takes an email address and a password, and we email you a code to verify the address. To link your form, open the Admin Link in the email you got after activating, press Link, log in and press Link again to confirm. If you’ve lost that email, each submission email has a link that sends you a new one. The endpoint URL stays the same, so there’s nothing to change in your site. Then 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, then add the hidden field below to your form, export or edit the file and upload it again. Any submission with a value in that field is marked as spam and not sent to you.
<!-- Only on a linked form with Set Honeypot Field set to "website". -->
<div aria-hidden="true" style="position: absolute; left: -10000px">
<label for="website">Leave this field empty</label>
<input
id="website"
name="website"
type="text"
tabindex="-1"
autocomplete="off"
/>
</div>
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 you link to a free account. Past the limit, messages stop reaching your inbox and your visitor still sees the normal thank-you page, so we email you when you get close and when you hit it. See plans and pricing for the rest.
The prompt to paste into Claude
Make the contact form on this page submit to Un-static, a hosted form backend.
- Change only the form, and make sure this is a single plain HTML page, not React.
- Use a plain HTML form: method="post" action="https://forms.un-static.com/forms/YOUR_ENDPOINT_REFERENCE".
- Remove any submit handler that calls preventDefault, and any success message tied to it. The browser must do a normal form post.
- Every input, select 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".
- Do not add hidden fields, captcha scripts or captcha widgets. Un-static handles spam protection.
- Do not add a netlify or data-netlify attribute, a serverless function, or code that saves entries in the artifact.
- Don't try to make the form submit from inside this artifact. I will export this page and host it elsewhere.
A later prompt such as “make the contact section prettier” can bring a submit handler back, so check the form again before each export.
Using Claude Code, Cursor or Copilot on a project of your own? 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
The export is HTML, so a working contact form is this:
<form
method="post"
action="https://forms.un-static.com/forms/YOUR_ENDPOINT_REFERENCE"
>
<label for="name">Name</label>
<input id="name" name="name" type="text" required />
<label for="email">Email address</label>
<input id="email" name="email" type="email" required />
<label for="message">Message</label>
<textarea id="message" name="message" rows="6" required></textarea>
<button type="submit">Send message</button>
</form>
Keep whatever classes Claude put on the elements; styling doesn’t affect the post. What does:
nameon every field. The browser only sends fields that have aname, and that name is the label you see in the email. Anidalone sends nothing.- A field named
email. It has no special meaning until you link the form and enteremailunder Set “Reply To” field in step 7. - No hidden field yet. Without an account there is no honeypot, so leave it out.
- No submit handler that prevents the default. This is the kind of code to remove:
// Sends nothing: preventDefault() cancels the post.
form.addEventListener('submit', (e) => { e.preventDefault(); showThanks(); });
Want the message to send without leaving the page? There is an /ajax route on the same endpoint for JavaScript submits, but your page has to show the captcha widget itself, so it needs a form linked to an account with your own captcha keys, or captcha turned off. Check success in the JSON reply, because a refused submission still returns HTTP 200. 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. 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 ask Claude for. On top of that, submissions containing 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 7 sits next to it. None of this is a paid feature.
Frequently asked questions
Can the form work inside the artifact or on the published artifact link?
Not as far as we can see. The policy we read on www.claudeusercontent.com only allows form posts back to that host. We haven’t tested a post from a live published artifact, so treat that as our reading. Even if a post got through, a new chat artifact needs a Claude account to open. Exporting avoids both questions.
I only have the link, not the file. What now?
If you made the artifact, open it in Claude and export from the title menu. On a legacy artifact, use the controls at the top of the artifact panel to download or copy the code. You can also ask Claude in that chat for the code as a single HTML file and save it as index.html yourself. If someone else made it, ask them for the file.
Do I need Claude Code?
No. Everything here happens in a Claude chat, on forms.un-static.com and at your host. Claude Academy points to Claude Code for building a version you run yourself.
Will this work on Netlify, Vercel or GitHub Pages?
Yes. The form posts to forms.un-static.com, not to your host, and that’s ordinary browser behaviour. The hosting docs we read describe nothing that interferes with it. You can also move hosts later without touching the form. On Netlify, keep the netlify and data-netlify attributes off the form tag.
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 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 site’s code don’t find it. What your visitors send is stored on our side as well as emailed to you.
If your test message never arrives, write to us with your endpoint reference and we’ll look it up.