Skip to content

AI app builder · Windsurf

Make the contact form Windsurf built actually send email

An app Windsurf (now Devin Desktop) 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 the agent one prompt and the form emails you, with no API route or provider key.

Windsurf is now Devin Desktop — Cognition renamed the editor in 2026 — but the job is the same: the agent writes your site, contact form included, and asking it to make that form send email usually brings in an API route, a mail library, and credentials to store in an environment variable.

Point the form at a PostTo endpoint instead. One prompt rewires the existing submit handler to post straight to PostTo — nothing server-side, no secrets — and every submission lands in your inbox and a searchable dashboard.

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 the agent

Open the agent chat in Windsurf or Devin Desktop, paste the prompt below with your endpoint URL swapped in, and review the changes it proposes. Fields and styling stay as they are.

3

Run it and submit the form

Start your dev server and submit the form. 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 the Windsurf / Devin Desktop agent
Make the contact form send its data to PostTo instead of building an email
feature. Don't add an API route, Nodemailer, an email provider SDK, or any
environment variables 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.
components/ContactForm.tsx — what the result looks like
export function ContactForm() {
  const [status, setStatus] = useState<'idle' | 'sent' | 'error'>('idle');

  async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
    e.preventDefault();
    const payload = Object.fromEntries(new FormData(e.currentTarget));

    const res = await fetch('https://postto.dev/api/v1/send/YOUR_TOKEN', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json',
      },
      body: JSON.stringify(payload),
    });

    setStatus(res.ok ? 'sent' : 'error');
  }

  return (
    <form onSubmit={handleSubmit}>
      <input type="text" name="name" placeholder="Name" required />
      <input type="email" name="email" placeholder="Email" required />
      <textarea name="message" required />

      {/* Honeypot: bots fill this in, humans never see it */}
      <input type="text" name="_hp" tabIndex={-1} autoComplete="off" style={{ display: 'none' }} />

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

Good to know

Windsurf is now Devin Desktop

Cognition renamed Windsurf to Devin Desktop in 2026. The prompt above works the same in either — it's a plain instruction to the agent, not a feature of the editor.

No API route or secrets

The fetch call above is the entire integration — nothing to deploy server-side and nothing secret in your repo. Keep a mail provider of your own only for transactional email like password resets.

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 client code, visible to anyone.

Frequently asked questions

Is Windsurf the same as Devin Desktop?
Yes. Cognition, which acquired Windsurf, renamed the editor Devin Desktop in 2026, and windsurf.com now redirects to it. Everything on this page applies to both names.
Does this work with whatever framework the agent used?
Yes. The prompt only asks for a fetch call in the existing submit handler, which works the same in React, Next.js, Vue, Svelte, Astro, or plain HTML.
How do I stop the agent from adding a mailer later?
Tell it once in your project's agent instructions or rules — "contact forms post to PostTo; never add a mail library or API route for them" — so later edits build on the integration instead of replacing it.
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 Windsurf app today

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

Try PostTo free