Skip to content

AI app builder · Claude

Make the contact form Claude built actually send email

A site Claude builds can't send email from the browser — the form needs a service to hand each message to. A PostTo endpoint is that service: give Claude or Claude Code one prompt and the form emails you, with no backend to deploy.

Claude writes a good-looking contact form in seconds, in a chat or with Claude Code in your repo. Ask it to make the form actually send email, though, and the honest answer involves a backend: a server route, an email provider, and credentials to keep out of the code.

Point the form at a PostTo endpoint instead. One prompt rewires the submit handler to post straight to PostTo, which filters spam, emails you the submission, and keeps it in a searchable dashboard. Nothing to deploy server-side, no secrets in the repo.

Free plan, no credit card required · Updated

Three steps, a few minutes

1

Create an endpoint

Sign up free and create a PostTo endpoint with your destination email. You get an endpoint URL immediately.

2

Paste the prompt into Claude

In Claude Code, paste the prompt below with your endpoint URL swapped in and let it edit the form. In a claude.ai chat, paste it alongside the page Claude made and copy the updated code.

3

Deploy and submit the form

Submit the form from your local dev server or deployed site. The email lands in your inbox, and the submission shows up in the PostTo dashboard right away.

The prompt and the code

Replace YOUR_TOKEN with the endpoint URL from your dashboard.

Prompt to paste into Claude or Claude Code
Make the contact form send its data to PostTo instead of building an email
feature. Don't add a server route, Nodemailer, SMTP settings, or an email
provider SDK for this. On submit, POST the form fields as JSON to
https://postto.dev/api/v1/send/YOUR_TOKEN from the client, with a
"Content-Type: application/json" and "Accept: application/json" header. Show
a success state if the response is ok and an error state otherwise. Add a
hidden "_hp" honeypot input that real visitors never see. Keep the existing
fields, validation, and styling unchanged.
index.html — the no-JavaScript version for a static page
<form action="https://postto.dev/api/v1/send/YOUR_TOKEN" method="POST">
  <input type="text" name="name" placeholder="Name" required>
  <input type="email" name="email" placeholder="Email" required>
  <textarea name="message" required></textarea>

  <!-- Honeypot: bots fill this in, humans never see it -->
  <input type="text" name="_hp" tabindex="-1" autocomplete="off" style="display:none">

  <!-- Where to send the visitor after a successful submission -->
  <input type="hidden" name="_next" value="https://yoursite.com/thanks">

  <button type="submit">Send</button>
</form>
CLAUDE.md — keep later Claude Code sessions on PostTo
## Contact forms
Forms post directly to PostTo from the client:
https://postto.dev/api/v1/send/YOUR_TOKEN (JSON, Accept: application/json).
Never add a server route, Nodemailer, SMTP settings, or an email provider SDK
for form submissions. Keep the hidden "_hp" honeypot input on every form.

Good to know

Test on your site, not in the chat preview

Artifact previews in claude.ai run in a sandbox that can block requests to outside URLs, so a form that works perfectly once deployed may appear to fail inside the chat. Submit it from your dev server or live site instead.

CLAUDE.md keeps it that way

Claude Code reads CLAUDE.md at the start of every session. A few lines there tell future sessions how forms work in this project, so a later refactor builds on PostTo instead of quietly adding a mailer.

Token only — never signed mode here

This request runs in the browser, so use the plain endpoint URL with its token. Never enable signed mode for a browser-side form — the HMAC secret would ship in your page, visible to anyone.

Frequently asked questions

Does this work for a single HTML page Claude made in a chat?
Yes — use the no-JavaScript form above. Host the page anywhere (GitHub Pages, Netlify, Cloudflare Pages) and the browser posts straight to PostTo, then redirects the visitor to your thanks page.
Why does the form fail inside the claude.ai preview?
Artifact previews are sandboxed and can block requests to outside URLs. That's a property of the preview, not your form — deploy the page or run it locally and the submission goes through.
Why not let Claude build the email sending itself?
It can, but then you own an email provider account, a sending domain with SPF and DKIM, credentials in your deployment, and spam handling. PostTo replaces all of that for contact forms; keep a provider of your own for transactional email like password resets.
What does it cost?
The free plan includes 50 submissions per month with the full dashboard — no credit card required. Paid plans start at $9/month.

Add a working form to your Claude app today

Create an endpoint, paste the prompt, and see your first submission in the dashboard — all on the free plan.

Try PostTo free