splitforms.com
← Back to the journal

Contact Form Without PHP: 3 Modern Alternatives (2026)

Build a contact form without PHP in 2026. Three modern alternatives that work on Vercel, Netlify, Cloudflare Pages, GitHub Pages, and any static host.

Start free — 500 submissionsSee pricing →No card, no time limit. Pro is $5 per month.
Short answer
You don't need PHP to run a contact form. Three modern alternatives work on any host — including static sites: point your form at a hosted backend like splitforms (https://splitforms.com/api/submit), write a tiny serverless function that calls Resend or Postmark, or use a Node.js service with SMTP. PHP is not required, not recommended, and not available on most modern hosting platforms.
Try it on your own form

Point any HTML form at one endpoint. 500 free submissions — no card, no time limit — and unlimited forms.

Create free account

Why skip PHP entirely?

PHP was the default for contact forms in 2005. In 2026, it's a liability. Here's why developers have moved on:

  • Most modern hosts don't support PHP. Vercel, Netlify, Cloudflare Pages, GitHub Pages, and S3 are static-only. If you deploy there, PHP isn't even an option.
  • PHP mail() has terrible deliverability. It sends through unauthenticated local sendmail, which means Gmail and Outlook silently route your form emails to spam.
  • Security headaches. PHP contact forms are a classic attack vector for header injection, cross-site scripting, and server exploitation. Every PHP form needs sanitization that's easy to forget.
  • No version conflicts. PHP 5.6, 7.4, 8.0, 8.1, 8.2 — hosting providers run different versions, and forms that work on one host break on another.

The good news: every modern alternative is faster to set up, more reliable, and free for small sites.

Option 1: Hosted form backend (recommended)

The fastest path to a working contact form. Sign up at splitforms.com, get your access key, and paste it into your HTML.

<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
  <input type="hidden" name="subject" value="New contact from yoursite.com" />
  <input type="hidden" name="redirect" value="https://yoursite.com/thanks" />

  <label>Name <input name="name" required /></label>
  <label>Email <input name="email" type="email" required /></label>
  <label>Message <textarea name="message" required></textarea></label>

  <input name="botcheck" type="checkbox" style="display:none" tabindex="-1" />
  <button type="submit">Send message</button>
</form>

That's the entire integration. splitforms handles spam filtering (honeypot, time-trap, IP rate limiting, and server-side content heuristics), authenticates outgoing email with SPF/DKIM, sets Reply-To to the visitor's email, and redirects them to your thank-you page. The same endpoint powers any form to email workflow — quote forms, signup forms, feedback widgets — not just a contact form.

Time to first email: ~90 seconds. Cost: $0 for 500 submissions total; $5/month for Pro (5,000 submissions).

Option 2: Serverless function + email API

You want ownership over the delivery pipeline. Write a small serverless function that receives the POST and calls a transactional email API.

Vercel Route Handler with Resend:

// app/api/contact/route.ts
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST(req: Request) {
  const data = await req.formData();

  if (data.get('botcheck')) return new Response('OK');

  const name = String(data.get('name') ?? '');
  const email = String(data.get('email') ?? '');
  const message = String(data.get('message') ?? '');

  const { error } = await resend.emails.send({
    from: 'forms@yourdomain.com',
    to: 'you@yourdomain.com',
    replyTo: email,
    subject: `Contact form: ${name}`,
    text: `From: ${name} <${email}>\n\n${message}`,
  });

  if (error) return new Response('Send failed', { status: 500 });
  return Response.redirect(new URL('/thanks', req.url), 303);
}

This works on Vercel, Netlify Functions, Cloudflare Workers, and any platform supporting serverless functions.

Option 3: JavaScript fetch + hosted API

Want to submit the form via AJAX without a page reload? Use the fetch API to POST to a hosted backend:

<form id="contact-form">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
  <input name="name" required />
  <input name="email" type="email" required />
  <textarea name="message" required></textarea>
  <button type="submit">Send</button>
</form>

<script>
const form = document.getElementById('contact-form');
form.addEventListener('submit', async (e) => {
  e.preventDefault();
  const res = await fetch('https://splitforms.com/api/submit', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(Object.fromEntries(new FormData(form))),
  });
  if (res.ok) window.location.href = '/thanks';
  else alert('Something went wrong. Please try again.');
});
</script>

This approach gives you a single-page-app feel while still using a hosted backend for email delivery and spam filtering.

Which approach should you pick?

ApproachSetup timeCostBest for
splitforms (hosted)~90 sec$0–5/moMost sites. Fastest path.
Serverless + Resend30–60 min$0–15/moTeams wanting full control
JS fetch + hosted API5 min$0–5/moSPAs, no-page-reload UX
PHP mail() (deprecated)5 minLost leadsNever, in 2026

Per-host compatibility

  • Vercel — no PHP runs on the platform at all. Point the form at splitforms (Option 1), or write a Route Handler like the one in Option 2.
  • Netlify — Netlify Forms is built in and current credit plans include free, unlimited submissions. Use it when the site will stay on Netlify; use splitforms' portable 500 total free endpoint when the form must survive a host migration.
  • Cloudflare Pages — static output can't send email; pair it with a Worker for Option 2, or use splitforms directly with zero Worker code.
  • GitHub Pages — pure static, no functions of any kind. A hosted backend is your only realistic path.
  • S3 + CloudFront — hosted backend, or API Gateway + Lambda if you want to own the pipeline on AWS.
  • Astro / Hugo / Eleventy / Jekyll — the generator is irrelevant to email delivery; the same options apply to whatever host serves the build.
  • WordPress — works with PHP, but splitforms is still better for deliverability.
  • Webflow / Framer / Carrd — embed splitforms in an HTML block.

Troubleshooting

Common issues when switching from PHP to a hosted backend:

  • Form submits but no email arrives — check that your access_key is correct and look in the splitforms dashboard for the submission.
  • CORS error in browser console — this only happens with the fetch approach. splitforms sets permissive CORS headers; the error is likely from a browser extension.
  • Redirect doesn't work — make sure the redirect hidden field contains a full URL (including https://).
  • Spam getting through — add the form_loaded_at time-trap field and turn on the domain allow-list in your splitforms dashboard. Combined with the honeypot and server-side content heuristics, that blocks most automated spam without a CAPTCHA.

Questions? Email hello@splitforms.com — we respond within a few hours.

Frequently asked questions

Can I create a contact form without PHP?

Yes. Point your HTML form's action attribute at a hosted form backend like splitforms (https://splitforms.com/api/submit), or write a serverless function on Vercel, Netlify, or Cloudflare Workers that calls a transactional email API. Both approaches deliver form submissions to your inbox without any PHP.

What is the best PHP alternative for contact forms?

For most sites, a hosted form backend is the fastest path. splitforms is free for 500 submissions total, requires no server, and handles spam filtering, email delivery, and webhooks. For teams that want full control, a serverless function plus Resend or Postmark is the next best option.

Do contact forms without PHP work on static hosting?

Yes. Hosted form backends like splitforms work on GitHub Pages, S3, Cloudflare Pages, Netlify, Vercel, and any other static host. The form submits directly to the backend endpoint via a normal POST request — no server-side code on your origin.

How do I send a contact form to email without a backend?

Use a hosted form backend. Sign up at splitforms.com, get your access key, and set your form's action to https://splitforms.com/api/submit. The backend handles email delivery with SPF/DKIM authentication, spam filtering, and redirects the user to your thank-you page.

Is splitforms really free?

Yes. The free plan includes 500 submissions total, unlimited forms, email notifications, spam filtering, and dashboard access. No credit card required. Paid plans are Pro at $5/month (5,000 submissions a month) and Annual at $49/year (15,000 a month).

Ship your contact form today

Stop fighting PHP. Ship in 90 seconds.
splitforms is free for 500 submissions total. No credit card. No server. No PHP. Just paste your access key and go.
Create your free account →

Keep reading

Related articles

More practical guidance from tutorials.

Browse the journal →
Comparisons

Static Site Form Handling: Every Method Compared (2026)

Compare every way to handle forms on a static site in 2026: form backend APIs, Netlify Forms…

7 min readRead →
Tutorials

How to Remove the Arrows From a Number Input (CSS, Tailwind, React)

Hide the number input spin buttons with ::-webkit-inner-spin-button and appearance: textfiel…

7 min readRead →
Tutorials

How to Change the Autofill Background Color of an Input (CSS, Tailwind)

Remove Chrome's yellow autofill background with input:-webkit-autofill, inset box-shadow, -w…

7 min readRead →

Explore this topic

Start with the overview, then move into focused guides.

OverviewContact Forms for Every FrameworkStart here →GuideContact Form for Next.jsRead →GuideContact Form for ReactRead →GuideContact Form for VueRead →ReferenceContact form guideOpen →

Building forms with ChatGPT, Claude, Cursor, or v0? Connect the native MCP server and give your agent a production form backend.

Explore the MCP server →

Give your form a production backend.

One endpoint adds delivery, spam filtering, storage, and integrations. Start with 500 free submissions — no card, no time limit.

Create free accountRead the docs →
Secure checkoutSSL encryptionPrivacyProtected
VISAAMERICANEXPRESSstripe