splitforms.com
All articles/ TUTORIALS9 MIN READPublished June 30, 2026

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.

✶ Written by
splitforms.com / blog

Founder of splitforms — the form backend API for developers. Writes about form UX, anti-spam, and shipping web apps without backend code.

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. splitformshandles spam filtering (honeypot + AI scoring), authenticates outgoing email with SPF/DKIM, sets Reply-To to the visitor's email, and redirects them to your thank-you page.

Time to first email: ~90 seconds. Cost: $0 for 500 submissions/month; $1/month for Starter; $5/month for Pro.

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. Use splitforms or a Route Handler.
  • Netlify — Netlify Forms works, but splitforms' free tier is 5x the volume.
  • Cloudflare Pages — pair with Workers or use splitforms directly.
  • GitHub Pages — pure static. Hosted backend is your path.
  • S3 + CloudFront — hosted backend, or Lambda + API Gateway.
  • 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 — enable the AI spam classifier in your splitforms dashboard. It catches 99.2% of spam without 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/month, 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 per month, unlimited forms, email notifications, spam filtering, and dashboard access. No credit card required. Paid plans start at $1/month (Starter) and $5/month (Pro). A 3-year plan is available for $59.

Ship your contact form today

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

Keep reading

About the author
✻ ✻ ✻

Get your free contact form API key in 60 seconds.

500 free form submissions per month. No credit card. No SDK, no PHP, no plugin. Drop one POST endpoint in your form and submissions land in your dashboard and can notify your inbox on every plan.

Generate access key →Read the docs
founders pricing locked in · early access open