integrations · framework

A contact form for Astro: no island, no adapter, no backend.

An Astro contact form doesn't need an SSR adapter, an API endpoint, or a framework island. Astro renders plain HTML by default, and a plain HTML form is all a contact form needs: point its action at your mailcontact endpoint and submissions land in your project's inbox, with a notification in Discord, Slack, email, or a webhook.

It ships zero JavaScript, works with Astro's fully static output on any host, and keeps working if you later add an adapter, because it's markup in a .astro page, not a plugin or a server route.

the snippet

A working form for Astro, in one paste.

Point the form at your project's mailcontact endpoint. Submissions land in your project inbox. No server, no API route, no email service to wire up.

src/pages/contact.astro
---
// No frontmatter needed: the form is plain HTML.
---

<form action="https://mailcontact.app/api/forms/your-form-id" method="POST">
  <input type="text" name="name" placeholder="Your name" required />
  <input type="email" name="email" placeholder="you@email.com" required />
  <textarea name="message" placeholder="What's on your mind?" required></textarea>
  <button type="submit">Send</button>
</form>

how it works

Three steps, start to finish.

01

Create an inbox

One inbox per project. Name it after your site and you get a form endpoint and a project email address immediately.

02

Paste the form

Drop the markup above into any .astro page or component: src/pages/contact.astro, a footer, a layout. It's your HTML; style it however you like.

03

Get notified

Add a Discord, Slack, email, or webhook channel. Every submission pings you where you already are.

why mailcontact

Built to pair well with Astro.

Zero JavaScript, zero islands

No client:load, no framework component, no hydration cost. The form is static HTML, which is exactly what Astro ships fastest.

No SSR adapter required

Astro's server endpoints need an adapter and a server to run on. Posting to an external endpoint keeps your build fully static. astro build, upload, done.

One inbox per site you ship

Astro makes it cheap to spin up marketing sites, docs, and side projects. Each one gets its own inbox and its own address instead of piling into your personal email.

faq

Astro + mailcontact, answered

Can Astro handle form submissions without a server?

Not by itself. A statically built Astro site has nothing running to receive a POST. Pointing the form's action at a mailcontact endpoint fixes that: mailcontact's servers accept the submission and your site stays fully static.

Does this work on Netlify, Vercel, GitHub Pages, or Cloudflare Pages?

Yes. The endpoint accepts cross-origin posts from any domain, so the form works wherever your static output is hosted. No adapter, functions, or host-specific form feature needed.

How do I show a success message instead of leaving the page?

Add a small script that intercepts submit and POSTs the FormData with fetch, then swap in your success state. A configurable redirect for native form posts is coming with the launch.

Can I style the form with Tailwind or scoped Astro styles?

Yes. It's your markup in your page, so scoped <style> blocks, Tailwind classes, or global CSS all apply as usual. mailcontact only cares about the field names: email and message are required, name and subject are optional.

related

Also works with

One inbox for every Astro project you ship.

Forms and a real email address, together, with notifications where you live. Launching soon. Be the first to know.

No spam. It's kind of our thing.